From: sashiko-bot@kernel.org
To: "Himal Prasad Ghimiray" <himal.prasad.ghimiray@intel.com>
Cc: dri-devel@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
amd-gfx@lists.freedesktop.org
Subject: Re: [RFC v2 05/11] drm/amdgpu: Use ttm_operation_ctx numa_info instead of per-partition pools
Date: Tue, 24 Nov 2026 06:31:44 +0000 [thread overview]
Message-ID: <sashiko-outbox-230598@kernel.org> (raw)
In-Reply-To: <20261124062123.2431244-18-himal.prasad.ghimiray@intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] drm/amdgpu: -EOPNOTSUPP in amdgpu_ttm_tt_populate() when
need_swiotlb is set
--
commit 0d7e02838b040282a0c34d64857fd1fdc0a04ed6
Author: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
drm/amdgpu: Use ttm_operation_ctx numa_info instead of per-partition pools
This commit removes the per-partition TTM pools on APUs with memory
partitions and allocates pages from the device pool using
TTM_NUMA_POLICY_PREFERRED in ttm_operation_ctx.
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index d3a875a32af1e..8740b7a76ad19 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
[ ... ]
> @@ -1242,7 +1245,9 @@ static int amdgpu_ttm_tt_populate(struct ttm_device *bdev,
> {
> struct amdgpu_device *adev = amdgpu_ttm_adev(bdev);
> struct amdgpu_ttm_tt *gtt = ttm_to_amdgpu_ttm_tt(ttm);
> - struct ttm_pool *pool;
> + /* ctx is shared by every BO of the operation; set the node locally */
> + struct ttm_operation_ctx node_ctx = *ctx;
> + nodemask_t preferred;
> pgoff_t i;
> int ret;
>
> @@ -1257,11 +1262,13 @@ static int amdgpu_ttm_tt_populate(struct ttm_device *bdev,
> if (ttm->page_flags & TTM_TT_FLAG_EXTERNAL)
> return 0;
>
> - if (adev->mman.ttm_pools && gtt->pool_id >= 0)
> - pool = &adev->mman.ttm_pools[gtt->pool_id];
> - else
> - pool = &adev->mman.bdev.pool;
> - ret = ttm_pool_alloc(pool, ttm, ctx);
> + if (gtt->numa_node != NUMA_NO_NODE) {
> + nodes_clear(preferred);
> + node_set(gtt->numa_node, preferred);
> + node_ctx.numa_info.policy = TTM_NUMA_POLICY_PREFERRED;
> + node_ctx.numa_info.nodes = &preferred;
> + }
> + ret = ttm_pool_alloc(&adev->mman.bdev.pool, ttm, &node_ctx);
[Severity: High]
Will ttm_pool_alloc() fail with -EOPNOTSUPP when adev->need_swiotlb is set
on a partitioned APU?
amdgpu_ttm_init() initializes adev->mman.bdev.pool with
TTM_ALLOCATION_POOL_USE_DMA_ALLOC when adev->need_swiotlb is true (for
example, under SME/SEV memory encryption), whereas the old
amdgpu_ttm_pools_init() omitted that flag on the per-partition pools.
Because ttm_pool_check_numa() rejects any policy other than
TTM_NUMA_POLICY_NONE when TTM_ALLOCATION_POOL_USE_DMA_ALLOC is set on the
pool, populating any BO with a partition NUMA node will now fail with
-EOPNOTSUPP.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261124062123.2431244-13-himal.prasad.ghimiray@intel.com?part=5
next prev parent reply other threads:[~2026-11-24 6:31 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 6:21 [RFC v2 00/11] drm/ttm, drm/xe: Per-BO host NUMA memory policy Himal Prasad Ghimiray
2026-11-24 6:21 ` [RFC v2 01/11] drm/ttm: Add NUMA placement policy to ttm_operation_ctx Himal Prasad Ghimiray
2026-11-24 6:21 ` [RFC v2 02/11] drm/ttm: Add TTM_NUMA_POLICY_BIND Himal Prasad Ghimiray
2026-11-24 6:29 ` sashiko-bot
2026-11-24 6:21 ` [RFC v2 03/11] drm/ttm: Add TTM_NUMA_POLICY_INTERLEAVE Himal Prasad Ghimiray
2026-11-24 6:32 ` sashiko-bot
2026-11-24 6:21 ` [RFC v2 04/11] drm/ttm/pool: enforce per-node cache limits on free Himal Prasad Ghimiray
2026-11-24 6:21 ` [RFC v2 05/11] drm/amdgpu: Use ttm_operation_ctx numa_info instead of per-partition pools Himal Prasad Ghimiray
2026-11-24 6:31 ` sashiko-bot [this message]
2026-11-24 6:21 ` [RFC v2 06/11] drm/ttm/pool: Drop the nid argument from ttm_pool_init() Himal Prasad Ghimiray
2026-11-24 6:21 ` [RFC v2 07/11] drm/xe/uapi: Add GEM_CREATE host NUMA mempolicy extension Himal Prasad Ghimiray
2026-11-24 6:21 ` [RFC v2 08/11] drm/xe/bo: Carry a per-BO host NUMA mempolicy Himal Prasad Ghimiray
2026-11-24 6:21 ` [RFC v2 09/11] drm/xe/uapi: Wire up GEM_CREATE mempolicy extension handler Himal Prasad Ghimiray
2026-11-24 6:21 ` [RFC v2 10/11] drm/xe/uapi: Add device query for supported host NUMA mempolicy modes Himal Prasad Ghimiray
2026-11-24 6:21 ` [RFC v2 11/11] drm/xe: Implement the host NUMA mempolicy device query Himal Prasad Ghimiray
2026-11-24 6:26 ` ✗ CI.KUnit: failure for drm/ttm, drm/xe: Per-BO host NUMA memory policy 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=sashiko-outbox-230598@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=amd-gfx@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=himal.prasad.ghimiray@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox