From: Felix Kuehling <felix.kuehling@amd.com>
To: Arnd Bergmann <arnd@kernel.org>,
Alex Deucher <Alexander.Deucher@amd.com>,
"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 2/2] drm/amdkfd: drop struct kfd_cu_info
Date: Wed, 27 Sep 2023 12:39:06 -0400 [thread overview]
Message-ID: <1a84d6bd-0215-4a57-9d04-c101ad429c5d@amd.com> (raw)
In-Reply-To: <bee15872-1ed6-44b8-815e-c9480e931c98@app.fastmail.com>
On 2023-09-26 15:29, Arnd Bergmann wrote:
> On Tue, Sep 26, 2023, at 20:47, Deucher, Alexander wrote:
>>> From: Arnd Bergmann <arnd@kernel.org>
>>> Subject: Re: [PATCH 2/2] drm/amdkfd: drop struct kfd_cu_info
>>>
>>> On Tue, Sep 26, 2023, at 18:39, Alex Deucher wrote:
>>>> I think this was an abstraction back from when kfd supported both
>>>> radeon and amdgpu. Since we just support amdgpu now, there is no more
>>>> need for this and we can use the amdgpu structures directly.
>>>>
>>>> This also avoids having the kfd_cu_info structures on the stack when
>>>> inlining which can blow up the stack.
>>>>
>>>> Cc: Arnd Bergmann <arnd@kernel.org>
>>>> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
>>> Nice cleanup!
>>>
>>> Acked-by: Arnd Bergmann <arnd@arndb.de>
>>>
>>> I guess you could fold patch 1/2 into this as it removes all the added code from
>>> that anyway.
>> I left it as a separate patch as I didn't get a chance to see when the
>> stack warning appeared and figured it might be a good way to mitigate
>> that on stable kernels if necessary without pulling in the whole
>> rework, but if not, I can just squash it into the second patch.
> Makes sense. FWIW, I had never seen the warning before updating
> to linux-next this week from an older snapshot from last month.
>
> My guess is that one of the recent changes made gcc take
> different inlining decisions so we end up with two copies
> of the cu_info in the same stack frame, even though the
> fundamental problem was there already.
I've seen this type of problem before because our data structures keep
growing. When we need to support more GPUs, or bigger GPUs with more
CUs, the arrays in those structures grow, and start blowing up the stack
in functions that didn't have a problem before.
Regards,
Felix
>
> Arnd
next prev parent reply other threads:[~2023-09-27 16:39 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 [this message]
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
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=1a84d6bd-0215-4a57-9d04-c101ad429c5d@amd.com \
--to=felix.kuehling@amd.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