All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Matthew Brost" <matthew.brost@intel.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v6 2/2] drm/xe: Make use of shrink_control::opportunistic_compaction hint
Date: Wed, 17 Jun 2026 03:28:53 +0000	[thread overview]
Message-ID: <20260617032853.76C841F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260617032218.1165929-3-matthew.brost@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Spurious runtime PM wakeups during opportunistic compaction reclaim.
--

commit 9d2dcd5b46c4108efa18e04768837bf386796338
Author: Matthew Brost <matthew.brost@intel.com>

drm/xe: Make use of shrink_control::opportunistic_compaction hint

This patch uses the new opportunistic_compaction hint in the Xe shrinker
to avoid backing up GPU memory during high-order fragmentation-driven
reclaim attempts. This prevents reclaim/rebind ping-pong behavior
without affecting order-0 reclaim.

> diff --git a/drivers/gpu/drm/xe/xe_shrinker.c b/drivers/gpu/drm/xe/xe_shrinker.c
> index 83374cd576608..198149f266c60 100644
> --- a/drivers/gpu/drm/xe/xe_shrinker.c
> +++ b/drivers/gpu/drm/xe/xe_shrinker.c
[ ... ]
> @@ -233,7 +240,14 @@ static unsigned long xe_shrinker_scan(struct shrinker *shrink, struct shrink_con
>  	}
>  
>  	sc->nr_scanned = nr_scanned;
> -	if (nr_scanned >= nr_to_scan || !can_backup)
> +	/*
> +	 * Stop after the purge pass for opportunistic high-order reclaim:
> +	 * the subsequent backup/writeback pass works at native page order
> +	 * and is unlikely to free a contiguous high-order block, so doing
> +	 * it here would just churn working sets for no compaction benefit.
> +	 */
> +	if (nr_scanned >= nr_to_scan || !can_backup ||
> +	    sc->opportunistic_compaction)
>  		goto out;

[Severity: Medium]
Does this cause a spurious runtime PM wakeup during opportunistic compaction?

Looking earlier in xe_shrinker_scan(), xe_shrinker_runtime_pm_get() is called
to eagerly wake up the device based on the can_backup flag:

	/* Might need runtime PM. Try to wake early if it looks like it. */
	runtime_pm = xe_shrinker_runtime_pm_get(shrinker, false, nr_to_scan, can_backup);

Since the early exit above skips the backup phase when opportunistic compaction
is requested, an asynchronous worker might still be queued to wake the GPU
from suspend even though the backup pass will never run.

Could the can_backup flag be updated to also incorporate the
sc->opportunistic_compaction state to prevent these wakeups?

>  
>  	/* If we didn't wake before, try to do it now if needed. */

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260617032218.1165929-1-matthew.brost@intel.com?part=2

  reply	other threads:[~2026-06-17  3:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-17  3:22 [PATCH v6 0/2] mm, drm/xe: Avoid reclaim/eviction loops under fragmentation Matthew Brost
2026-06-17  3:22 ` [PATCH v6 1/2] mm: Introduce opportunistic_compaction concept to vmscan and shrinkers Matthew Brost
2026-06-17  3:38   ` sashiko-bot
2026-06-17  3:22 ` [PATCH v6 2/2] drm/xe: Make use of shrink_control::opportunistic_compaction hint Matthew Brost
2026-06-17  3:28   ` sashiko-bot [this message]
2026-06-17  4:37 ` ✓ CI.KUnit: success for mm, drm/xe: Avoid reclaim/eviction loops under fragmentation Patchwork
2026-06-17  5:16 ` ✓ Xe.CI.BAT: " Patchwork
2026-06-17 10:55 ` ✓ 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=20260617032853.76C841F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@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.