Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Matthew Brost <matthew.brost@intel.com>, intel-xe@lists.freedesktop.org
Cc: thomas.hellstrom@linux.intel.com, himal.prasad.ghimiray@intel.com
Subject: Re: [PATCH] drm/xe: Use WRITE_ONCE for range->tile_invalidated update
Date: Wed, 11 Jun 2025 20:33:10 +0200	[thread overview]
Message-ID: <a5b76810-6476-49e1-82c2-7e6d3f81b240@linux.intel.com> (raw)
In-Reply-To: <20250604234712.2441130-1-matthew.brost@intel.com>

Reviewed-by: Maarten Lankhrost <maarten.lankhorst@linux.intel.com>

On 2025-06-05 01:47, Matthew Brost wrote:
> Updating range->tile_invalidated should be done with WRITE_ONCE to pair
> with READ_ONCE in opportunistic checks.
> 
> Signed-off-by: Matthew Brost <matthew.brost@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_svm.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_svm.c b/drivers/gpu/drm/xe/xe_svm.c
> index 83c63fd7b481..7df0bcea65fc 100644
> --- a/drivers/gpu/drm/xe/xe_svm.c
> +++ b/drivers/gpu/drm/xe/xe_svm.c
> @@ -141,7 +141,9 @@ xe_svm_range_notifier_event_begin(struct xe_vm *vm, struct drm_gpusvm_range *r,
>  	for_each_tile(tile, xe, id)
>  		if (xe_pt_zap_ptes_range(tile, vm, range)) {
>  			tile_mask |= BIT(id);
> -			range->tile_invalidated |= BIT(id);
> +			/* Pairs with READ_ONCE in xe_svm_range_is_valid */
> +			WRITE_ONCE(range->tile_invalidated,
> +				   range->tile_invalidated | BIT(id));
>  		}
>  
>  	return tile_mask;
> @@ -644,7 +646,8 @@ static bool xe_svm_range_is_valid(struct xe_svm_range *range,
>  {
>  	/*
>  	 * Advisory only check whether the range currently has a valid mapping,
> -	 * READ_ONCE pairs with WRITE_ONCE in xe_pt.c
> +	 * READ_ONCE pairs with WRITE_ONCE in xe_pt.c,
> +	 * xe_svm_range_notifier_event_begin
>  	 */
>  	return ((READ_ONCE(range->tile_present) &
>  		 ~READ_ONCE(range->tile_invalidated)) & BIT(tile->id)) &&


      parent reply	other threads:[~2025-06-11 18:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-04 23:47 [PATCH] drm/xe: Use WRITE_ONCE for range->tile_invalidated update Matthew Brost
2025-06-05  4:05 ` ✓ CI.Patch_applied: success for " Patchwork
2025-06-05  4:05 ` ✓ CI.checkpatch: " Patchwork
2025-06-05  4:07 ` ✓ CI.KUnit: " Patchwork
2025-06-05  4:17 ` ✓ CI.Build: " Patchwork
2025-06-05  4:20 ` ✓ CI.Hooks: " Patchwork
2025-06-05  4:21 ` ✓ CI.checksparse: " Patchwork
2025-06-05  5:10 ` ✓ Xe.CI.BAT: " Patchwork
2025-06-06 12:54 ` ✗ Xe.CI.Full: failure " Patchwork
2025-06-11 18:33 ` Maarten Lankhorst [this message]

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=a5b76810-6476-49e1-82c2-7e6d3f81b240@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.com \
    --cc=himal.prasad.ghimiray@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.brost@intel.com \
    --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