From: aquiles <achillezongo07@gmail.com>
To: matthew.brost@intel.com, thomas.hellstrom@linux.intel.com,
rodrigo.vivi@intel.com
Cc: airlied@gmail.com, simona@ffwll.ch,
intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, aquiles <achillezongo07@gmail.com>
Subject: [PATCH 1/2] drm/xe: count UMA shrinkable BOs as reclaimable without swap
Date: Fri, 26 Jun 2026 11:26:37 +0000 [thread overview]
Message-ID: <20260626112638.2042298-1-achillezongo07@gmail.com> (raw)
On integrated (UMA) devices all GPU buffer objects reside in system RAM.
xe_shrinker_count() previously gated shrinkable (non-purgeable) page
counts on ttm_backup_bytes_avail(), so those pages were invisible to
the kernel's memory reclaim on systems without swap configured.
On UMA, shrinkable system-memory BOs can be reclaimed independently of
swap availability. Report them unconditionally so the shrinker can
always request their eviction under memory pressure.
Signed-off-by: aquiles <achillezongo07@gmail.com>
---
drivers/gpu/drm/xe/xe_shrinker.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/xe/xe_shrinker.c b/drivers/gpu/drm/xe/xe_shrinker.c
index 83374cd57..3ca2de342 100644
--- a/drivers/gpu/drm/xe/xe_shrinker.c
+++ b/drivers/gpu/drm/xe/xe_shrinker.c
@@ -140,16 +140,22 @@ xe_shrinker_count(struct shrinker *shrink, struct shrink_control *sc)
{
struct xe_shrinker *shrinker = to_xe_shrinker(shrink);
unsigned long num_pages;
+ long uma_reclaimable_pages;
bool can_backup = !!(sc->gfp_mask & __GFP_FS);
+ bool is_uma = !IS_DGFX(shrinker->xe);
num_pages = ttm_backup_bytes_avail() >> PAGE_SHIFT;
read_lock(&shrinker->lock);
+ uma_reclaimable_pages = is_uma ? shrinker->shrinkable_pages : 0;
+
if (can_backup)
- num_pages = min_t(unsigned long, num_pages, shrinker->shrinkable_pages);
+ num_pages = min_t(unsigned long, num_pages,
+ shrinker->shrinkable_pages - uma_reclaimable_pages);
else
num_pages = 0;
+ num_pages += uma_reclaimable_pages;
num_pages += shrinker->purgeable_pages;
read_unlock(&shrinker->lock);
--
2.54.0
next reply other threads:[~2026-06-26 11:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-26 11:26 aquiles [this message]
2026-06-26 11:26 ` [PATCH 2/2] drm/xe: skip resv fence wait in xe_svm_invalidate if no ranges are bound aquiles
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=20260626112638.2042298-1-achillezongo07@gmail.com \
--to=achillezongo07@gmail.com \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew.brost@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=simona@ffwll.ch \
--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
all inboxes | Powered by JetHome®