From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>,
Matthew Brost <matthew.brost@intel.com>
Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
kernel-dev@igalia.com, "Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Thadeu Lima de Souza Cascardo" <cascardo@igalia.com>
Subject: Re: [PATCH v3 5/5] drm/amdgpu: Configure max beneficial TTM pool allocation order
Date: Fri, 10 Oct 2025 16:14:26 +0200 [thread overview]
Message-ID: <f32a164197b7d25dff42432007b9926ec5575e2f.camel@linux.intel.com> (raw)
In-Reply-To: <01bacdec-f1bd-4ddc-a537-6a091c1a1eb8@igalia.com>
On Thu, 2025-10-09 at 09:58 +0100, Tvrtko Ursulin wrote:
>
> On 09/10/2025 00:18, Matthew Brost wrote:
> > On Wed, Oct 08, 2025 at 12:53:14PM +0100, Tvrtko Ursulin wrote:
> > > Let the TTM pool allocator know that we can afford for it to
> > > expend less
> > > effort for satisfying contiguous allocations larger than 2MiB.
> > > The latter
> > > is the maximum relevant PTE entry size and the driver and
> > > hardware are
> > > happy to get larger blocks only opportunistically.
> > >
> > > Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
> > > Cc: Alex Deucher <alexander.deucher@amd.com>
> > > Cc: Christian König <christian.koenig@amd.com>
> > > Cc: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
> >
> > +Thomas - Seems like we'd want to do this in Xe too?
Yeah, Indeed.
While IIRC we can actually set up 1GiB PTEs, I'm not aware of any huge
benefits from using that compared to 2MiB ones. We certainly want the
allocator to try pretty hard for 2MiB ones, though.
Thanks,
Thomas
> >
> > > ---
> > > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 5 +++--
> > > 1 file changed, 3 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> > > b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> > > index 948c6d0a422b..723b885210a7 100644
> > > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> > > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> > > @@ -1837,7 +1837,7 @@ static int amdgpu_ttm_pools_init(struct
> > > amdgpu_device *adev)
> > > for (i = 0; i < adev->gmc.num_mem_partitions; i++) {
> > > ttm_pool_init(&adev->mman.ttm_pools[i], adev-
> > > >dev,
> > > adev-
> > > >gmc.mem_partitions[i].numa.node,
> > > - 0);
> > > +
> > > TTM_POOL_BENEFICIAL_ORDER(get_order(2 * SZ_1M)));
> >
> > SZ_2M btw.
>
> I thought I grepped exactly to see if that existed but apparently I
> did
> not, thanks!
>
> Regards,
>
> Tvrtko
>
> >
> > Matt
> >
> > > }
> > > return 0;
> > > }
> > > @@ -1931,7 +1931,8 @@ int amdgpu_ttm_init(struct amdgpu_device
> > > *adev)
> > > adev_to_drm(adev)->anon_inode-
> > > >i_mapping,
> > > adev_to_drm(adev)-
> > > >vma_offset_manager,
> > > (adev->need_swiotlb ?
> > > TTM_POOL_USE_DMA_ALLOC : 0) |
> > > - (dma_addressing_limited(adev-
> > > >dev) ? TTM_POOL_USE_DMA32 : 0));
> > > + (dma_addressing_limited(adev-
> > > >dev) ? TTM_POOL_USE_DMA32 : 0) |
> > > +
> > > TTM_POOL_BENEFICIAL_ORDER(get_order(2 * SZ_1M)));
> > > if (r) {
> > > dev_err(adev->dev,
> > > "failed initializing buffer object
> > > driver(%d).\n", r);
> > > --
> > > 2.48.0
> > >
>
next prev parent reply other threads:[~2025-10-10 14:14 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-08 11:53 [PATCH v3 0/5] Improving the worst case TTM large allocation latency Tvrtko Ursulin
2025-10-08 11:53 ` [PATCH v3 1/5] drm/ttm: Add getter for some pool properties Tvrtko Ursulin
2025-10-08 11:53 ` [PATCH v3 2/5] drm/ttm: Replace multiple booleans with flags in pool init Tvrtko Ursulin
2025-10-10 15:10 ` kernel test robot
2025-10-08 11:53 ` [PATCH v3 3/5] drm/ttm: Replace multiple booleans with flags in device init Tvrtko Ursulin
2025-10-08 11:53 ` [PATCH v3 4/5] drm/ttm: Allow drivers to specify maximum beneficial TTM pool size Tvrtko Ursulin
2025-10-08 11:53 ` [PATCH v3 5/5] drm/amdgpu: Configure max beneficial TTM pool allocation order Tvrtko Ursulin
2025-10-08 23:18 ` Matthew Brost
2025-10-09 8:58 ` Tvrtko Ursulin
2025-10-10 14:14 ` Thomas Hellström [this message]
2025-10-13 7:03 ` Christian König
2025-10-08 12:35 ` [PATCH v3 0/5] Improving the worst case TTM large allocation latency Christian König
2025-10-08 13:50 ` Tvrtko Ursulin
2025-10-08 14:02 ` Christian König
2025-10-08 14:39 ` Thomas Hellström
2025-10-09 8:53 ` Tvrtko Ursulin
2025-10-10 14:11 ` Thomas Hellström
2025-10-10 14:18 ` Thomas Hellström
2025-10-11 8:00 ` Tvrtko Ursulin
2025-10-13 8:48 ` Thomas Hellström
2025-10-13 9:17 ` Tvrtko Ursulin
2025-10-13 9:23 ` Tvrtko Ursulin
2025-10-08 14:34 ` Matthew Auld
2025-10-09 8:41 ` Tvrtko Ursulin
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=f32a164197b7d25dff42432007b9926ec5575e2f.camel@linux.intel.com \
--to=thomas.hellstrom@linux.intel.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=cascardo@igalia.com \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-dev@igalia.com \
--cc=matthew.brost@intel.com \
--cc=tvrtko.ursulin@igalia.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;
as well as URLs for NNTP newsgroup(s).