From: Donet Tom <donettom@linux.ibm.com>
To: "Christian König" <christian.koenig@amd.com>,
amd-gfx@lists.freedesktop.org,
"Felix Kuehling" <Felix.Kuehling@amd.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Philip Yang" <yangp@amd.com>
Cc: Kent.Russell@amd.com, Ritesh Harjani <ritesh.list@gmail.com>,
Vaidyanathan Srinivasan <svaidy@linux.ibm.com>,
Mukesh Kumar Chaurasiya <mkchauras@linux.ibm.com>
Subject: Re: [RFC PATCH v1 4/8] amdgpu/amdgpu_ttm: Fix AMDGPU_GTT_MAX_TRANSFER_SIZE for non-4K page size
Date: Tue, 6 Jan 2026 18:25:08 +0530 [thread overview]
Message-ID: <c28b117f-b3bb-42de-a1fb-a4dceccfbb72@linux.ibm.com> (raw)
In-Reply-To: <277c65ad-a3c3-4d99-a0f4-a6ca99e61ab4@amd.com>
[-- Attachment #1: Type: text/plain, Size: 3058 bytes --]
On 12/12/25 2:23 PM, Christian König wrote:
> On 12/12/25 07:40, Donet Tom wrote:
>> The SDMA engine has a hardware limitation of 4 MB maximum transfer
>> size per operation.
> That is not correct. This is only true on ancient HW.
>
> What problems are you seeing here?
>
>> AMDGPU_GTT_MAX_TRANSFER_SIZE was hardcoded to
>> 512 pages, which worked correctly on systems with 4K pages but fails
>> on systems with larger page sizes.
>>
>> This patch divides the max transfer size / AMDGPU_GPU_PAGES_IN_CPU_PAGE
>> to match with non-4K page size systems.
> That is actually a bad idea. The value was meant to match the PMD size.
Hi Christian, Felix, Alex and philip
Instead of hardcoding the AMDGPU_GTT_MAX_TRANSFER_SIZE value to 512,
what do you think about doing something like the change below?
This should work across all architectures and page sizes, so
AMDGPU_GTT_MAX_TRANSFER_SIZE will always correspond to the PMD
size on all architectures and with all page sizes.
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h
index 0be2728aa872..c594ed7dff18 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h
@@ -37,7 +37,7 @@
#define AMDGPU_PL_MMIO_REMAP (TTM_PL_PRIV + 5)
#define __AMDGPU_PL_NUM (TTM_PL_PRIV + 6)
-#define AMDGPU_GTT_MAX_TRANSFER_SIZE 512
+#define AMDGPU_GTT_MAX_TRANSFER_SIZE 1 << (PMD_SHIFT - PAGE_SHIFT)
#define AMDGPU_GTT_NUM_TRANSFER_WINDOWS
Could you please provide your thoughts on above? Is it looking ok to you?
If this looks good - here is what we were thinking:
Patches 1-4 are required to fix initial non-4k pagesize support to AMD GPU.
And since these patches are looking in good shape (since Philip has already
reviewed [1-3])- We thought it will be good to split the patch series into two.
I will send a v2 of Part-1 with patches [1-4] (will also address the review comments
in v2 for Patch-1 & 2 from Philip) and for the rest of the patches [5-8] Part-2, we
can continue the discussion till other things are sorted. That will also allow us to
get these initial fixes in Part-1 ready before the 6.20 merge window.
Thoughts?
>
> Regards,
> Christian.
>
>> Signed-off-by: Donet Tom<donettom@linux.ibm.com>
>> Signed-off-by: Ritesh Harjani (IBM)<ritesh.list@gmail.com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h
>> index 0be2728aa872..9d038feb25b0 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h
>> @@ -37,7 +37,7 @@
>> #define AMDGPU_PL_MMIO_REMAP (TTM_PL_PRIV + 5)
>> #define __AMDGPU_PL_NUM (TTM_PL_PRIV + 6)
>>
>> -#define AMDGPU_GTT_MAX_TRANSFER_SIZE 512
>> +#define AMDGPU_GTT_MAX_TRANSFER_SIZE (512 / AMDGPU_GPU_PAGES_IN_CPU_PAGE)
>> #define AMDGPU_GTT_NUM_TRANSFER_WINDOWS 2
>>
>> extern const struct attribute_group amdgpu_vram_mgr_attr_group;
[-- Attachment #2: Type: text/html, Size: 4163 bytes --]
next prev parent reply other threads:[~2026-01-06 12:55 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-12 6:40 [RFC PATCH v1 0/8] amdgpu/amdkfd: Add support for non-4K page size systems Donet Tom
2025-12-12 6:40 ` [RFC PATCH v1 1/8] drm/amdkfd: Relax size checking during queue buffer get Donet Tom
2025-12-15 20:25 ` Philip Yang
2025-12-16 10:12 ` Donet Tom
2025-12-12 6:40 ` [RFC PATCH v1 2/8] amdkfd/kfd_svm: Fix SVM map/unmap address conversion for non-4k page sizes Donet Tom
2025-12-15 20:44 ` Philip Yang
2025-12-16 10:09 ` Donet Tom
2025-12-12 6:40 ` [RFC PATCH v1 3/8] amdkfd/kfd_migrate: Fix GART PTE for non-4K pagesize in svm_migrate_gart_map() Donet Tom
2025-12-15 21:03 ` Philip Yang
2025-12-12 6:40 ` [RFC PATCH v1 4/8] amdgpu/amdgpu_ttm: Fix AMDGPU_GTT_MAX_TRANSFER_SIZE for non-4K page size Donet Tom
2025-12-12 8:53 ` Christian König
2025-12-12 12:14 ` Donet Tom
2026-01-06 12:55 ` Donet Tom [this message]
2026-01-08 12:31 ` Christian König
2026-01-09 10:22 ` Pierre-Eric Pelloux-Prayer
2026-01-09 12:57 ` Donet Tom
2025-12-12 6:40 ` [RFC PATCH v1 5/8] amdkfd/kfd_chardev: Add error message for non-4k pagesize failures Donet Tom
2025-12-12 6:40 ` [RFC PATCH v1 6/8] drm/amdgpu: Handle GPU page faults correctly on non-4K page systems Donet Tom
2025-12-12 6:40 ` [RFC PATCH v1 7/8] amdgpu: Align ctl_stack_size and wg_data_size to GPU page size instead of CPU page size Donet Tom
2025-12-12 9:04 ` Christian König
2025-12-12 12:29 ` Donet Tom
2025-12-19 10:27 ` Donet Tom
2026-01-06 13:01 ` Donet Tom
2025-12-12 6:40 ` [RFC PATCH v1 8/8] amdgpu: Fix MQD and control stack alignment for non-4K CPU page size systems Donet Tom
2025-12-12 9:01 ` [RFC PATCH v1 0/8] amdgpu/amdkfd: Add support for non-4K " Christian König
2025-12-12 10:45 ` Ritesh Harjani
2025-12-12 13:01 ` Christian König
2025-12-12 17:24 ` Alex Deucher
2025-12-15 9:47 ` Christian König
2025-12-15 10:11 ` Donet Tom
2025-12-15 16:11 ` Christian König
2025-12-16 10:08 ` Donet Tom
2025-12-16 16:06 ` Christian König
2025-12-17 9:04 ` Donet Tom
2025-12-17 9:46 ` Donet Tom
2025-12-17 10:10 ` Christian König
2025-12-15 14:09 ` Alex Deucher
2025-12-16 13:54 ` Donet Tom
2025-12-16 14:02 ` Alex Deucher
2025-12-17 9:03 ` Donet Tom
2025-12-17 14:23 ` Alex Deucher
2025-12-17 21:31 ` Yat Sin, David
2026-01-02 18:53 ` Donet Tom
2026-01-06 12:58 ` Donet Tom
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=c28b117f-b3bb-42de-a1fb-a4dceccfbb72@linux.ibm.com \
--to=donettom@linux.ibm.com \
--cc=Felix.Kuehling@amd.com \
--cc=Kent.Russell@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=mkchauras@linux.ibm.com \
--cc=ritesh.list@gmail.com \
--cc=svaidy@linux.ibm.com \
--cc=yangp@amd.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