Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [Intel-xe] [PATCH 1/2] drm/xe: Make page-table updates using the default engine happen in order
Date: Fri, 30 Jun 2023 02:18:07 +0000	[thread overview]
Message-ID: <ZJ47X2PmlPDNbFrj@DUT025-TGLU.fm.intel.com> (raw)
In-Reply-To: <20230629205134.111849-2-thomas.hellstrom@linux.intel.com>

On Thu, Jun 29, 2023 at 10:51:33PM +0200, Thomas Hellström wrote:
> If the default engine m->eng was used, there is no check for idle and
> a cpu page-table update may thus happen in parallel with a gpu one.
> Don't allow CPU page-table updates with the default engine until
> the engine is idle.
> 
> Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>

Reviewed-by: Matthew Brost <matthew.brost@intel.com>

> ---
>  drivers/gpu/drm/xe/xe_migrate.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c
> index 55e113dd7e82..41c90f6710ee 100644
> --- a/drivers/gpu/drm/xe/xe_migrate.c
> +++ b/drivers/gpu/drm/xe/xe_migrate.c
> @@ -1160,9 +1160,10 @@ xe_migrate_update_pgtables(struct xe_migrate *m,
>  	int err = 0;
>  	bool usm = !eng && xe->info.supports_usm;
>  	bool first_munmap_rebind = vma && vma->first_munmap_rebind;
> +	struct xe_engine *eng_override = !eng ? m->eng : eng;
>  
>  	/* Use the CPU if no in syncs and engine is idle */
> -	if (no_in_syncs(syncs, num_syncs) && (!eng || xe_engine_is_idle(eng))) {
> +	if (no_in_syncs(syncs, num_syncs) && xe_engine_is_idle(eng_override)) {
>  		fence =  xe_migrate_update_pgtables_cpu(m, vm, bo, updates,
>  							num_updates,
>  							first_munmap_rebind,
> -- 
> 2.40.1
> 

  reply	other threads:[~2023-06-30  2:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-29 20:51 [Intel-xe] [PATCH 0/2] drm/xe: Fix two bind races Thomas Hellström
2023-06-29 20:51 ` [Intel-xe] [PATCH 1/2] drm/xe: Make page-table updates using the default engine happen in order Thomas Hellström
2023-06-30  2:18   ` Matthew Brost [this message]
2023-06-29 20:51 ` [Intel-xe] [PATCH 2/2] drm/xe: Fix the separate bind-engine race using coarse-granularity dependencies Thomas Hellström
2023-07-01  4:21   ` Matthew Brost
2023-07-02 21:13     ` Thomas Hellström
2023-06-29 20:54 ` [Intel-xe] ✓ CI.Patch_applied: success for drm/xe: Fix two bind races Patchwork
2023-06-29 20:54 ` [Intel-xe] ✓ CI.checkpatch: " Patchwork
2023-06-29 20:56 ` [Intel-xe] ✓ CI.KUnit: " Patchwork
2023-06-29 20:59 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-06-29 21:00 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-06-29 21:01 ` [Intel-xe] ✗ CI.checksparse: warning " Patchwork
2023-06-29 21:45 ` [Intel-xe] ○ CI.BAT: info " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZJ47X2PmlPDNbFrj@DUT025-TGLU.fm.intel.com \
    --to=matthew.brost@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=thomas.hellstrom@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox