From: sashiko-bot@kernel.org
To: "Shuicheng Lin" <shuicheng.lin@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v7 1/2] drm/xe/shrinker: Return the freed page count through a parameter
Date: Wed, 09 Sep 2026 16:29:18 +0000 [thread overview]
Message-ID: <20260909162919.5B2A01F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260909162102.1097006-2-shuicheng.lin@intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] The LRU shrinker walk aborts entirely upon encountering a buffer object (BO) that is unsuitable for shrinking, potentially causing a livelock where the shrinker fails to make progress.
--
commit fdbe7158df33982691ee678948191c46bf0f5148
Author: Shuicheng Lin <shuicheng.lin@intel.com>
drm/xe/shrinker: Return the freed page count through a parameter
This commit refactors __xe_shrinker_walk() and xe_shrinker_walk() to return
status errors and accumulate freed pages via a parameter. This prevents
dropping the count of already freed pages when an error occurs during the scan.
> diff --git a/drivers/gpu/drm/xe/xe_shrinker.c b/drivers/gpu/drm/xe/xe_shrinker.c
> index 83374cd576608..89445cd202380 100644
> --- a/drivers/gpu/drm/xe/xe_shrinker.c
> +++ b/drivers/gpu/drm/xe/xe_shrinker.c
[ ... ]
> @@ -82,7 +83,7 @@ static s64 __xe_shrinker_walk(struct xe_device *xe,
> if (lret < 0)
> return lret;
>
> - freed += lret;
> + *freed += lret;
[Severity: High]
This is a pre-existing issue, but does this early return abort the entire
shrinker walk if a single buffer object is unsuitable for shrinking?
In xe_bo_shrink() located in drivers/gpu/drm/xe/xe_bo.c, -EBUSY is
legitimately returned if the BO cannot be shrunk. For instance, when
a non-purgeable BO is encountered during a purge pass:
if (!(tt->page_flags & TTM_TT_FLAG_EXTERNAL_MAPPABLE) ||
(flags.purge && !xe_tt->purgeable))
return -EBUSY;
if (!xe_bo_eviction_valuable(bo, &place))
return -EBUSY;
If __xe_shrinker_walk() receives this -EBUSY, the entire iteration is aborted.
Because the iteration starts from the head of the LRU, an unshrinkable BO at
the head could perpetually abort the shrinker on its first step, failing to
make progress under memory pressure.
Should the loop ignore -EBUSY and continue scanning?
> if (*scanned >= to_scan)
> break;
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260909162102.1097006-1-shuicheng.lin@intel.com?part=1
next prev parent reply other threads:[~2026-09-09 16:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-09 16:21 [PATCH v7 0/2] drm/xe/shrinker: Runtime PM reference for non-system memory Shuicheng Lin
2026-09-09 16:21 ` [PATCH v7 1/2] drm/xe/shrinker: Return the freed page count through a parameter Shuicheng Lin
2026-09-09 16:29 ` sashiko-bot [this message]
2026-09-09 20:53 ` Lin, Shuicheng
2026-09-09 16:21 ` [PATCH v7 2/2] drm/xe/shrinker: Take a runtime PM ref before shrinking non-system memory Shuicheng Lin
2026-09-09 16:33 ` sashiko-bot
2026-09-09 17:50 ` ✓ CI.KUnit: success for drm/xe/shrinker: Runtime PM reference for non-system memory (rev2) Patchwork
2026-09-09 18:56 ` ✗ Xe.CI.BAT: failure " Patchwork
2026-09-10 15:53 ` Lin, Shuicheng
2026-09-10 4:49 ` ✗ Xe.CI.FULL: " Patchwork
2026-09-10 15:47 ` Lin, Shuicheng
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=20260909162919.5B2A01F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=shuicheng.lin@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