AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Alex Deucher <alexander.deucher@amd.com>, amd-gfx@lists.freedesktop.org
Cc: Arnd Bergmann <arnd@kernel.org>
Subject: Re: [PATCH 1/2] drm/amdkfd: reduce stack size in kfd_topology_add_device()
Date: Wed, 27 Sep 2023 07:31:13 +0200	[thread overview]
Message-ID: <7ba44481-5b4e-9de1-bf16-85cd47fb61ca@gmail.com> (raw)
In-Reply-To: <20230926163938.1013775-1-alexander.deucher@amd.com>

Am 26.09.23 um 18:39 schrieb Alex Deucher:
> kfd_topology.c:2082:1: warning: the frame size of 1440 bytes is larger than 1024 bytes
>
> Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2866
> Cc: Arnd Bergmann <arnd@kernel.org>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Acked-by: Christian König <christian.koenig@amd.com> for the series, but 
Felix probably want to take a look as well.

> ---
>   drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 13 +++++++++----
>   1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
> index c8c75ff7cea8..3f9f882d3f5c 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
> @@ -1918,7 +1918,7 @@ int kfd_topology_add_device(struct kfd_node *gpu)
>   {
>   	uint32_t gpu_id;
>   	struct kfd_topology_device *dev;
> -	struct kfd_cu_info cu_info;
> +	struct kfd_cu_info *cu_info;
>   	int res = 0;
>   	int i;
>   	const char *asic_name = amdgpu_asic_name[gpu->adev->asic_type];
> @@ -1959,8 +1959,11 @@ int kfd_topology_add_device(struct kfd_node *gpu)
>   	/* Fill-in additional information that is not available in CRAT but
>   	 * needed for the topology
>   	 */
> +	cu_info = kzalloc(sizeof(struct kfd_cu_info), GFP_KERNEL);
> +	if (!cu_info)
> +		return -ENOMEM;
>   
> -	amdgpu_amdkfd_get_cu_info(dev->gpu->adev, &cu_info);
> +	amdgpu_amdkfd_get_cu_info(dev->gpu->adev, cu_info);
>   
>   	for (i = 0; i < KFD_TOPOLOGY_PUBLIC_NAME_SIZE-1; i++) {
>   		dev->node_props.name[i] = __tolower(asic_name[i]);
> @@ -1970,7 +1973,7 @@ int kfd_topology_add_device(struct kfd_node *gpu)
>   	dev->node_props.name[i] = '\0';
>   
>   	dev->node_props.simd_arrays_per_engine =
> -		cu_info.num_shader_arrays_per_engine;
> +		cu_info->num_shader_arrays_per_engine;
>   
>   	dev->node_props.gfx_target_version =
>   				gpu->kfd->device_info.gfx_target_version;
> @@ -2051,7 +2054,7 @@ int kfd_topology_add_device(struct kfd_node *gpu)
>   	 */
>   	if (dev->gpu->adev->asic_type == CHIP_CARRIZO) {
>   		dev->node_props.simd_count =
> -			cu_info.simd_per_cu * cu_info.cu_active_number;
> +			cu_info->simd_per_cu * cu_info->cu_active_number;
>   		dev->node_props.max_waves_per_simd = 10;
>   	}
>   
> @@ -2078,6 +2081,8 @@ int kfd_topology_add_device(struct kfd_node *gpu)
>   
>   	kfd_notify_gpu_change(gpu_id, 1);
>   
> +	kfree(cu_info);
> +
>   	return 0;
>   }
>   


  parent reply	other threads:[~2023-09-27  5:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-26 16:39 [PATCH 1/2] drm/amdkfd: reduce stack size in kfd_topology_add_device() Alex Deucher
2023-09-26 16:39 ` [PATCH 2/2] drm/amdkfd: drop struct kfd_cu_info Alex Deucher
2023-09-26 17:48   ` Arnd Bergmann
2023-09-26 18:47     ` Deucher, Alexander
2023-09-26 19:29       ` Arnd Bergmann
2023-09-27 16:39         ` Felix Kuehling
2023-09-27 16:49   ` Felix Kuehling
2023-09-26 17:38 ` [PATCH 1/2] drm/amdkfd: reduce stack size in kfd_topology_add_device() Arnd Bergmann
2023-09-27  5:31 ` Christian König [this message]
2023-09-27 16:40 ` Felix Kuehling

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=7ba44481-5b4e-9de1-bf16-85cd47fb61ca@gmail.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=arnd@kernel.org \
    /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