All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: Matthew Brost <matthew.brost@intel.com>, sashiko-reviews@lists.linux.dev
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH] drm/xe: Keep walking on SVM eviction failure
Date: Wed, 09 Sep 2026 09:55:52 +0200	[thread overview]
Message-ID: <a17944e24497617abc5ea17f991347c82de09448.camel@linux.intel.com> (raw)
In-Reply-To: <aqBif1V2aY92MxRG@gsse-cloud1.jf.intel.com>

On Tue, 2026-09-08 at 12:31 -0700, Matthew Brost wrote:
> On Tue, Sep 08, 2026 at 06:55:22PM +0000,
> sashiko-bot@kernel.org wrote:
> > Thank you for your contribution! Sashiko AI review found 1
> > potential issue(s) to consider:
> > - [Medium] Unconditionally masking `xe_svm_bo_evict()` errors as `-
> > ENOSPC` hides fatal errors and triggers TTM error log spam.
> > --
> > 
> > commit 8fcbc00a7aa0e3b2119f7df96129747882247423
> > Author: Matthew Brost <matthew.brost@intel.com>
> > 
> > drm/xe: Keep walking on SVM eviction failure
> > 
> > This commit adjusts the error handling in xe_bo_move() for SVM
> > eviction
> > failures. It overwrites the return code from xe_svm_bo_evict() with
> > -ENOSPC
> > to force TTM to continue walking the LRU list for eviction
> > candidates.
> > 
> > > diff --git a/drivers/gpu/drm/xe/xe_bo.c
> > > b/drivers/gpu/drm/xe/xe_bo.c
> > > --- a/drivers/gpu/drm/xe/xe_bo.c
> > > +++ b/drivers/gpu/drm/xe/xe_bo.c
> > > @@ -1043,6 +1043,11 @@ 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 is
> > > +			 * keep walking for eviction, which is -
> > > ENOSPC.
> > > +			 */
> > > +			ret = -ENOSPC;
> > 
> > [Severity: Medium]
> > Does unconditionally overwriting the error with -ENOSPC hide fatal
> > errors like
> > -ENOMEM?
> > 
> > When system memory is exhausted, xe_svm_bo_evict() can return -
> > ENOMEM. By
> > masking this as -ENOSPC, it seems we might break proper error
> > propagation to
> > higher layers, preventing expected OOM handling.
> > 
> 
> Yea.. Perhaps -ENOMEM should actually be returned to the upper layers
> as
> this indicates we are out of system memory and attemping more
> evictions
> is unlikely to help.
> 
> Second opinion from the Xe team on this one?

IMO we should just convert specific errors (or exclude specific errors)
and add a motivation in the commit message for future reference.

Thanks,
Thomas



> 
> > Furthermore, could this trigger a TTM error log spam loop? When
> > returned to
> > TTM, -ENOSPC causes ttm_bo_evict() to log an unconditional
> > pr_err("Buffer eviction failed\n"). Since -ENOSPC is converted to -
> > EBUSY in
> > ttm_bo_evict_cb(), it signals the LRU walker
> > (ttm_lru_walk_for_evict()) to
> > skip the BO and continue walking. 
> > 
> > During genuine resource exhaustion, this might cause a fruitless
> > iteration over
> > the entire LRU list, logging a pr_err() for every single buffer
> > object. Even
> > benign SVM races might spam the kernel log with errors.
> > 
> 
> The spam is probably seperate issue in TTM. -ENOSPC likely shouldn't
> emit a pr_err as it continues walking.
> 
> Matt
> 
> > >  		}
> > >  
> > >  		goto out;
> > 
> > -- 
> > Sashiko AI review ·
> > https://sashiko.dev/#/patchset/20260908184346.92332-1-matthew.brost@intel.com?part=1

  reply	other threads:[~2026-09-09  7:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08 18:43 [PATCH] drm/xe: Keep walking on SVM eviction failure Matthew Brost
2026-09-08 18:51 ` ✓ CI.KUnit: success for " Patchwork
2026-09-08 18:55 ` [PATCH] " sashiko-bot
2026-09-08 19:31   ` Matthew Brost
2026-09-09  7:55     ` Thomas Hellström [this message]
2026-09-08 19:37 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-09-09  2:50 ` ✗ Xe.CI.FULL: failure " 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=a17944e24497617abc5ea17f991347c82de09448.camel@linux.intel.com \
    --to=thomas.hellstrom@linux.intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.brost@intel.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.