From: sashiko-bot@kernel.org
To: "Tejas Upadhyay" <tejas.upadhyay@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH V17 11/12] drm/xe/uapi: Expose ban reason in EXEC_QUEUE_GET_PROPERTY_BAN
Date: Tue, 18 Aug 2026 10:58:24 +0000 [thread overview]
Message-ID: <20260818105824.8482E1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260818104055.3833974-25-tejas.upadhyay@intel.com>
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [Medium] Missing memory barrier in guc_exec_queue_reset_status allows speculative reads to mask PAGE_OFFLINE reason.
- [Medium] Non-LR (traditional) exec queues fail to inherit the PAGE_OFFLINE ban reason when a VM page table is purged.
- [Medium] The PAGE_OFFLINE ban reason is masked and lost for multi-queue setups if a secondary queue's LRC BO is purged.
--
--- Patch [11]: [PATCH V17 11/12] drm/xe/uapi: Expose ban reason in EXEC_QUEUE_GET_PROPERTY_BAN ---
commit 45e4d4a3182723f090e735c94ca31b96821f9856
Author: Tejas Upadhyay <tejas.upadhyay@intel.com>
drm/xe/uapi: Expose ban reason in EXEC_QUEUE_GET_PROPERTY_BAN
Extend DRM_XE_EXEC_QUEUE_GET_PROPERTY_BAN to return a bitmask indicating
the reason for the ban, rather than a simple boolean.
> diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
> --- a/drivers/gpu/drm/xe/xe_guc_submit.c
> +++ b/drivers/gpu/drm/xe/xe_guc_submit.c
> @@ -2570,13 +2580,25 @@ static void guc_exec_queue_multi_queue_drop_suspend(struct xe_exec_queue *q)
> }
> }
>
> -static bool guc_exec_queue_reset_status(struct xe_exec_queue *q)
> +static u64 guc_exec_queue_reset_status(struct xe_exec_queue *q)
> {
> - if (xe_exec_queue_is_multi_queue_secondary(q) &&
> - guc_exec_queue_reset_status(xe_exec_queue_multi_queue_primary(q)))
> - return true;
> + if (xe_exec_queue_is_multi_queue_secondary(q)) {
> + u64 status = guc_exec_queue_reset_status(xe_exec_queue_multi_queue_primary(q));
> +
> + if (status)
> + return status;
> + }
[Severity: Medium]
If a secondary queue's LRC BO is purged, xe_ttm_vram_purge_page() will tag
the secondary queue with the PAGE_OFFLINE ban reason. However, since this
delegates to the primary queue here, won't this mask the secondary queue's
specific reason if the primary queue defaults to GPU_HANG?
> +
> + if (exec_queue_reset(q) || exec_queue_killed_or_banned_or_wedged(q)) {
> + u64 reason = atomic_read_acquire(&q->ban_reason);
[Severity: Medium]
Is a memory barrier needed here before reading the ban reason?
When a CPU reads the queue status in guc_exec_queue_reset_status()
concurrently with xe_ttm_vram_purge_page() updating it, there is a control
dependency (the if block) before using atomic_read_acquire() on the ban
reason.
Since control dependencies do not order subsequent reads against preceding
reads, could the CPU speculatively execute the ban_reason read before the
state read resolves?
If it observes a 0, it would incorrectly default to GPU_HANG instead of
PAGE_OFFLINE. Should we add an smp_rmb() before reading the ban_reason?
> +
> + /* If no specific reason was recorded, default to GPU hang */
> + if (!reason)
> + reason = DRM_XE_EXEC_QUEUE_BAN_REASON_GPU_HANG;
> + return reason;
> + }
> +
> + return 0;
> }
> diff --git a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
> --- a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
> +++ b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
> @@ -596,7 +597,12 @@ static int xe_ttm_vram_purge_page(struct xe_device *xe, struct xe_bo *bo)
> xe_bo_unlock(bo);
> /* Ban VM if BO is PPGTT */
> if (vm && (flags & XE_BO_FLAG_PAGETABLE)) {
> + struct xe_exec_queue *eq;
> +
> down_write(&vm->lock);
> + list_for_each_entry(eq, &vm->preempt.exec_queues, lr.link)
> + atomic_or(DRM_XE_EXEC_QUEUE_BAN_REASON_PAGE_OFFLINE, &eq->ban_reason);
[Severity: Medium]
Does this loop miss non-LR (traditional) exec queues sharing the same VM?
This iterates strictly over vm->preempt.exec_queues, which only contains LR
queues. If a non-LR queue is associated with a purged VM, it seems it will
fail to inherit the PAGE_OFFLINE ban reason.
It would then eventually time out, trigger the TDR, and be tagged with the
default GPU_HANG reason, which might provide misleading information to
userspace.
> + smp_wmb(); /* Force all queue bits to be visible before killing the VM */
> xe_vm_kill(vm, true);
> up_write(&vm->lock);
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260818104055.3833974-14-tejas.upadhyay@intel.com?part=11
next prev parent reply other threads:[~2026-08-18 10:58 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-18 10:40 [PATCH V17 00/12] Add memory page offlining support Tejas Upadhyay
2026-08-18 10:40 ` [PATCH V17 01/12] drm/xe: Link VRAM object with gpu buddy Tejas Upadhyay
2026-08-18 10:40 ` [PATCH V17 02/12] drm/xe: Link LRC BO and its execution Queue Tejas Upadhyay
2026-08-18 10:40 ` [PATCH V17 03/12] drm/xe: Extend BO purge to handle vram pages as well Tejas Upadhyay
2026-08-18 10:40 ` [PATCH V17 04/12] drm/xe/bo: Make xe_bo_is_user() public Tejas Upadhyay
2026-08-18 10:41 ` [PATCH V17 05/12] drm/xe: Guard teardown paths against purged BOs Tejas Upadhyay
2026-08-18 11:06 ` sashiko-bot
2026-08-18 10:41 ` [PATCH V17 06/12] drm/xe/vram: Extract buddy alloc and free helpers Tejas Upadhyay
2026-08-18 10:41 ` [PATCH V17 07/12] drm/xe/vram: Add page offline data structures and lifecycle Tejas Upadhyay
2026-08-18 10:51 ` sashiko-bot
2026-08-18 10:41 ` [PATCH V17 08/12] drm/xe/vram: Add VRAM page offline fault handler Tejas Upadhyay
2026-08-18 11:01 ` sashiko-bot
2026-08-18 10:41 ` [PATCH V17 09/12] drm/xe/configfs: Add vram bad page reservation policy Tejas Upadhyay
2026-08-18 10:57 ` sashiko-bot
2026-08-18 10:41 ` [PATCH V17 10/12] drm/xe: Add sysfs interface for bad gpu vram pages Tejas Upadhyay
2026-08-18 10:54 ` sashiko-bot
2026-08-18 10:41 ` [PATCH V17 11/12] drm/xe/uapi: Expose ban reason in EXEC_QUEUE_GET_PROPERTY_BAN Tejas Upadhyay
2026-08-18 10:58 ` sashiko-bot [this message]
2026-08-18 10:41 ` [PATCH V17 12/12] drm/xe: Add fault-inject based VRAM page offline injection Tejas Upadhyay
2026-08-18 10:55 ` sashiko-bot
2026-08-18 10:49 ` ✓ CI.KUnit: success for Add memory page offlining support (rev19) Patchwork
2026-08-18 11:47 ` ✓ CI.KUnit: success for Add memory page offlining support (rev20) Patchwork
2026-08-18 12:28 ` ✗ Xe.CI.BAT: failure " Patchwork
2026-08-18 12:59 ` [PATCH V17 00/12] Add memory page offlining support Rodrigo Vivi
2026-08-18 13:24 ` Upadhyay, Tejas
2026-08-18 13:12 ` ✗ Xe.CI.FULL: failure for Add memory page offlining support (rev20) 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=20260818105824.8482E1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=tejas.upadhyay@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