Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ghimiray, Himal Prasad" <himal.prasad.ghimiray@intel.com>
To: Matthew Brost <matthew.brost@intel.com>,
	<intel-xe@lists.freedesktop.org>
Cc: <stable@vger.kernel.org>
Subject: Re: [PATCH v2] drm/xe: Keep walking on SVM eviction failure
Date: Fri, 18 Sep 2026 08:54:36 +0530	[thread overview]
Message-ID: <3e296c16-1535-4187-8ca2-52ec6390db59@intel.com> (raw)
In-Reply-To: <20260917203158.292823-1-matthew.brost@intel.com>



On 18-09-2026 02:01, Matthew Brost wrote:
> The desired behavior for SVM eviction failures, which can occur due to
> various uncontrollable races, is for TTM to continue walking the LRU
> list and look for another eviction candidate. This is expressed by
> returning -ENOSPC from the ->move() callback.
> 
> Adjust the SVM eviction failure path because of races in ->move() to
> return -ENOSPC so that TTM continues searching for another buffer to
> evict.
> 
> Fixes: 3ca608dc7561 ("drm/xe: Basic SVM BO eviction")
> Cc: stable@vger.kernel.org
> Signed-off-by: Matthew Brost <matthew.brost@intel.com>
> 
> ---
> v2:
>   - Only convert -EBUSY (races) to -ENOSPC
> ---
>   drivers/gpu/drm/xe/xe_bo.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
> index 9f3f0cb95afa..f2ab9bf43a86 100644
> --- a/drivers/gpu/drm/xe/xe_bo.c
> +++ b/drivers/gpu/drm/xe/xe_bo.c
> @@ -1044,6 +1044,13 @@ static int xe_bo_move(struct ttm_buffer_object *ttm_bo, bool evict,
>   		} else {
>   			drm_dbg(&xe->drm, "Evict system allocator BO failed=%pe\n",
>   				ERR_PTR(ret));
> +			/*
> +			 * The semantic we want upon SVM eviction failure
> +			 * because of racing access is keep walking for
> +			 * eviction, which is -ENOSPC.
> +			 */
> +			if (ret == -EBUSY)
> +				ret = -ENOSPC;

LGTM
Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>

>   		}
>   
>   		goto out;


  parent reply	other threads:[~2026-09-18  3:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-17 20:31 [PATCH v2] drm/xe: Keep walking on SVM eviction failure Matthew Brost
2026-09-17 22:03 ` ✓ CI.KUnit: success for drm/xe: Keep walking on SVM eviction failure (rev2) Patchwork
2026-09-17 23:21 ` ✓ Xe.CI.BAT: " Patchwork
2026-09-18  3:24 ` Ghimiray, Himal Prasad [this message]
2026-09-18  4:12 ` ✓ Xe.CI.FULL: " 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=3e296c16-1535-4187-8ca2-52ec6390db59@intel.com \
    --to=himal.prasad.ghimiray@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.brost@intel.com \
    --cc=stable@vger.kernel.org \
    /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