From: sashiko-bot@kernel.org
To: "Tejas Upadhyay" <tejas.upadhyay@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH V17 07/12] drm/xe/vram: Add page offline data structures and lifecycle
Date: Tue, 18 Aug 2026 10:51:23 +0000 [thread overview]
Message-ID: <20260818105123.923E81F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260818104055.3833974-21-tejas.upadhyay@intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] RCU-001 Violation: Synchronous freeing of buddy blocks before list removal.
--
--- Patch [7]: [PATCH V17 07/12] drm/xe/vram: Add page offline data structures and lifecycle ---
commit f7feb662373b2ef4fb339b58b4b97a02acc79be4
Author: Tejas Upadhyay <tejas.upadhyay@intel.com>
drm/xe/vram: Add page offline data structures and lifecycle
This commit adds xe_ttm_vram_offline_resource to track individual offlined VRAM
pages, and extends xe_ttm_vram_mgr with offlined_pages/queued_pages lists and
their counters. It also initializes the lists and adds a teardown path to release
all tracked pages.
> diff --git a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
> index 16ecea4977809..5513dc014f3e7 100644
> --- a/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
> +++ b/drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
[ ... ]
> @@ -338,12 +338,35 @@ static void xe_ttm_vram_mgr_set_unused(struct drm_device *dev, void *arg)
> ttm_resource_manager_set_used(man, false);
> }
>
> +static void xe_ttm_vram_free_bad_pages(struct xe_ttm_vram_mgr *mgr)
> +{
> + struct xe_ttm_vram_offline_resource *pos, *n;
> +
> + list_for_each_entry_safe(pos, n, &mgr->offlined_pages, offlined_link) {
> + xe_ttm_vram_buddy_free(mgr, &pos->blocks, pos->used_visible_size);
> + list_del_rcu(&pos->offlined_link);
[Severity: Medium]
Does this violate RCU removal ordering by freeing resources before unlinking?
The buddy blocks are freed synchronously before the object is unlinked from the
RCU-protected offlined_pages list. While this is currently called during the
serialized teardown phase, freeing internal resources before unlinking the
object breaks RCU invariants. A concurrent reader could access pos->blocks
after it has been freed. Should list_del_rcu() happen before
xe_ttm_vram_buddy_free()?
> + --mgr->n_offlined_pages;
> + kfree_rcu(pos, rcu);
> + }
> + list_for_each_entry_safe(pos, n, &mgr->queued_pages, queued_link) {
> + /* queued entries have no buddy reservation yet */
> + xe_ttm_vram_buddy_free(mgr, &pos->blocks, 0);
> + list_del_rcu(&pos->queued_link);
[Severity: Medium]
Similarly, does this pose the same RCU removal ordering issue?
The buddy blocks are freed before unlinking the object from the RCU-protected
queued_pages list.
> + --mgr->n_queued_pages;
> + kfree_rcu(pos, rcu);
> + }
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260818104055.3833974-14-tejas.upadhyay@intel.com?part=7
next prev parent reply other threads:[~2026-08-18 10:51 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 [this message]
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
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=20260818105123.923E81F00A3A@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 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.