All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Auld <matthew.auld@intel.com>
To: Matthew Brost <matthew.brost@intel.com>,
	intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v6 1/3] drm/xe: Bump the LRU on a successful page fault
Date: Wed, 28 Oct 2026 09:59:26 +0000	[thread overview]
Message-ID: <dcbb570b-0f53-4df2-9d17-62c66a80a8c4@intel.com> (raw)
In-Reply-To: <20261027224902.1085762-2-matthew.brost@intel.com>

On 27/10/2026 22:49, Matthew Brost wrote:
> Servicing a page fault validates the VMA's backing store and binds it,
> making the BO part of the VM's active working set, but unlike exec it
> never moves anything on the TTM LRU. In fault mode, where a VM may run
> for a long time without a single exec, the BOs the GPU actually touches
> therefore drift towards the LRU head and are picked by eviction and by
> the shrinker ahead of genuinely cold BOs.
> 
> Bump the BO's LRU on a successful page fault.
> 
> Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
> Signed-off-by: Matthew Brost <matthew.brost@intel.com>
> ---
>   drivers/gpu/drm/xe/xe_pagefault.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xe/xe_pagefault.c b/drivers/gpu/drm/xe/xe_pagefault.c
> index 5247321c805e..6828f81df50e 100644
> --- a/drivers/gpu/drm/xe/xe_pagefault.c
> +++ b/drivers/gpu/drm/xe/xe_pagefault.c
> @@ -201,6 +201,8 @@ static int xe_pagefault_handle_vma(struct xe_gt *gt, struct xe_vma *vma,
>   		xe_validation_ctx_init(&ctx, &vm->xe->val, &exec,
>   				       (struct xe_val_flags) {});
>   		drm_exec_until_all_locked(&exec) {
> +			struct xe_bo *bo = xe_vma_bo(vma);
> +
>   			err = xe_pagefault_begin(&exec, vma, tile->mem.vram,
>   						 needs_vram == 1);
>   			drm_exec_retry_on_contention(&exec);
> @@ -221,6 +223,11 @@ static int xe_pagefault_handle_vma(struct xe_gt *gt, struct xe_vma *vma,
>   				xe_pagefault_set_error(pf, XE_PAGEFAULT_ERROR_VMA_REBIND);
>   				break;
>   			}
> +
> +			if (bo) {
> +				scoped_guard(spinlock, &vm->xe->ttm.lru_lock)
> +					ttm_bo_move_to_lru_tail(&bo->ttm);

Would it be cleaner to just use ttm_bo_move_to_lru_tail_unlocked() 
without the scoped guard stuff?

Reviewed-by: Matthew Auld <matthew.auld@intel.com>

> +			}
>   		}
>   		xe_validation_ctx_fini(&ctx);
>   	} while (err == -EAGAIN);


  reply	other threads:[~2026-10-28  9:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-27 22:48 [PATCH v6 0/3] Add a minimum age gate to the shrinker + LRU fixes Matthew Brost
2026-10-27 22:49 ` [PATCH v6 1/3] drm/xe: Bump the LRU on a successful page fault Matthew Brost
2026-10-28  9:59   ` Matthew Auld [this message]
2026-10-28 21:25     ` Matthew Brost
2026-10-27 22:49 ` [PATCH v6 2/3] drm/ttm: Allow skipping to the next priority in the bo LRU cursor Matthew Brost
2026-10-28 11:33   ` Natalie Vock
2026-10-28 22:07     ` Matthew Brost
2026-10-27 22:49 ` [PATCH v6 3/3] drm/xe: Add a minimum age gate to the shrinker Matthew Brost
2026-10-27 23:17   ` sashiko-bot
2026-10-27 23:41 ` ✓ CI.KUnit: success for Add a minimum age gate to the shrinker + LRU fixes (rev3) Patchwork
2026-10-28  0:22 ` ✓ Xe.CI.BAT: " Patchwork
2026-10-28  3:51 ` ✓ 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=dcbb570b-0f53-4df2-9d17-62c66a80a8c4@intel.com \
    --to=matthew.auld@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.brost@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 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.