AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Philip Yang <yangp@amd.com>
To: "Kuehling, Felix" <felix.kuehling@amd.com>,
	Philip Yang <Philip.Yang@amd.com>,
	amd-gfx@lists.freedesktop.org
Cc: christian.koenig@amd.com, david.yatsin@amd.com
Subject: Re: [PATCH v2 3/4] drm/amdkfd: Move gfx9 MQD to VRAM domain
Date: Thu, 4 Dec 2025 17:51:22 -0500	[thread overview]
Message-ID: <fec99fdd-a8b5-4c48-a835-31ac604f3755@amd.com> (raw)
In-Reply-To: <98c9d511-e590-4a70-9b41-d42196b812bb@amd.com>



On 2025-12-03 12:55, Kuehling, Felix wrote:
> On 2025-12-01 09:28, Philip Yang wrote:
>> To reduce queue switch latency further, move MQD to VRAM domain, add
>> AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS flag to allocate contiguous pages
>> using one buddy block.
>
> Why does it need to be contiguous? In the next patch you're mapping it 
> in the GART anyway.
Without AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS flag, amdgpu_bo_gpu_offset 
trigger this warning

     WARN_ON_ONCE(bo->tbo.resource->mem_type == TTM_PL_VRAM &&
              !(bo->flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS));

This makes senses because we pass the FB aperture address to CP, this 
should be contiguous pages.

Regards,
Philip
>
> Regards,
>   Felix
>
>
>>
>> Signed-off-by: Philip Yang <Philip.Yang@amd.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c      | 3 ++-
>>   drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c | 2 +-
>>   2 files changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c 
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
>> index 9cd1660b8f60..c11e37915365 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
>> @@ -329,7 +329,8 @@ int amdgpu_amdkfd_alloc_gtt_mem(struct 
>> amdgpu_device *adev, size_t size,
>>       bp.size = size;
>>       bp.byte_align = PAGE_SIZE;
>>       bp.domain = domain;
>> -    bp.flags = AMDGPU_GEM_CREATE_CPU_GTT_USWC;
>> +    bp.flags = AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS |
>> +           AMDGPU_GEM_CREATE_CPU_GTT_USWC;
>>       bp.type = ttm_bo_type_kernel;
>>       bp.resv = NULL;
>>       bp.bo_ptr_size = sizeof(struct amdgpu_bo);
>> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c 
>> b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c
>> index a489d43d5f64..c6945c842267 100644
>> --- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c
>> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c
>> @@ -139,7 +139,7 @@ static struct kfd_mem_obj *allocate_mqd(struct 
>> kfd_node *node,
>>               (ALIGN(q->ctl_stack_size, PAGE_SIZE) +
>>               ALIGN(sizeof(struct v9_mqd), PAGE_SIZE)) *
>>               NUM_XCC(node->xcc_mask),
>> -            AMDGPU_GEM_DOMAIN_GTT,
>> +            AMDGPU_GEM_DOMAIN_VRAM,
>>               &(mqd_mem_obj->gtt_mem),
>>               &(mqd_mem_obj->gpu_addr),
>>               (void *)&(mqd_mem_obj->cpu_ptr), true);


  parent reply	other threads:[~2025-12-04 22:51 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-01 14:28 [PATCH v2 0/4] drm/amdkfd: Move gfx9 MQD to HBM Philip Yang
2025-12-01 14:28 ` [PATCH v2 1/4] drm/amdkfd: Bind gfx9 MQD in GART with mtype RW Philip Yang
2025-12-03 17:40   ` Kuehling, Felix
2025-12-04 15:10     ` Philip Yang
2025-12-01 14:28 ` [PATCH v2 2/4] drm/amdkfd: Add domain parameter to alloc kernel BO Philip Yang
2025-12-01 17:38   ` Russell, Kent
2025-12-01 20:31     ` Philip Yang
2025-12-01 22:48       ` Russell, Kent
2025-12-03 17:45       ` Kuehling, Felix
2025-12-01 14:28 ` [PATCH v2 3/4] drm/amdkfd: Move gfx9 MQD to VRAM domain Philip Yang
2025-12-03 17:55   ` Kuehling, Felix
2025-12-04 19:28     ` Philip Yang
2025-12-04 22:51     ` Philip Yang [this message]
2025-12-05 19:46       ` Felix Kuehling
2025-12-05 21:22         ` Philip Yang
2025-12-01 14:28 ` [PATCH v2 4/4] drm/amdkfd: Map VRAM MQD on GART Philip Yang
2025-12-03 16:06   ` Christian König
2025-12-04 22:43     ` Philip Yang
2025-12-05  9:30       ` Christian König
2025-12-03 15:52 ` [PATCH v2 0/4] drm/amdkfd: Move gfx9 MQD to HBM Philip Yang

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=fec99fdd-a8b5-4c48-a835-31ac604f3755@amd.com \
    --to=yangp@amd.com \
    --cc=Philip.Yang@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=david.yatsin@amd.com \
    --cc=felix.kuehling@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