Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Akhil P Oommen" <quic_akhilpo@quicinc.com>,
	"Dmitry Baryshkov" <dmitry.baryshkov@linaro.org>
Cc: "Arnd Bergmann" <arnd@kernel.org>,
	"Rob Clark" <robdclark@gmail.com>,
	"Abhinav Kumar" <quic_abhinavk@quicinc.com>,
	"Dave Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Sean Paul" <sean@poorly.run>,
	"Konrad Dybcio" <konradybcio@kernel.org>,
	"Marijn Suijten" <marijn.suijten@somainline.org>,
	"Nick Desaulniers" <ndesaulniers@google.com>,
	"Bill Wendling" <morbo@google.com>,
	"Justin Stitt" <justinstitt@google.com>,
	linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
	freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	llvm@lists.linux.dev
Subject: Re: [PATCH] drm: a6xx: avoid excessive stack usage
Date: Mon, 21 Oct 2024 10:01:27 +0000	[thread overview]
Message-ID: <cb728358-ac32-4b37-a954-967f338385e2@app.fastmail.com> (raw)
In-Reply-To: <20241021092509.tm4w3ufdgcd7of37@hu-akhilpo-hyd.qualcomm.com>

On Mon, Oct 21, 2024, at 09:25, Akhil P Oommen wrote:
> On Sat, Oct 19, 2024 at 04:14:13PM +0300, Dmitry Baryshkov wrote:
>> On Sat, Oct 19, 2024 at 03:01:46PM +0530, Akhil P Oommen wrote:
>> > On Fri, Oct 18, 2024 at 03:11:38PM +0000, Arnd Bergmann wrote:
>> > > From: Arnd Bergmann <arnd@arndb.de>
>> > > 
>> > > Clang-19 and above sometimes end up with multiple copies of the large
>> > > a6xx_hfi_msg_bw_table structure on the stack. The problem is that
>> > > a6xx_hfi_send_bw_table() calls a number of device specific functions to
>> > > fill the structure, but these create another copy of the structure on
>> > > the stack which gets copied to the first.
>> > > 
>> > > If the functions get inlined, that busts the warning limit:
>> > > 
>> > > drivers/gpu/drm/msm/adreno/a6xx_hfi.c:631:12: error: stack frame size (1032) exceeds limit (1024) in 'a6xx_hfi_send_bw_table' [-Werror,-Wframe-larger-than]
>> > 
>> > Why does this warning says that the limit is 1024? 1024 bytes is too small, isn't it?
>> 
>> Kernel stacks are expected to be space limited, so 1024 is a logical
>> limit for a single function.
>
> Thanks for the clarification. I think it is better to move this table to
> struct a6xx_gmu which is required anyway when we implement dynamic generation
> of bw table. Also, we can skip initializing it in subsequent gpu wake ups.
>
> Arnd, do you think that would be sufficient? I can send that patch if you
> want help.

Yes, that should work. I actually tried first to turn the model
specific data into static const structures but that ended up 
not working because some of them have a couple of dynamically
computed values. I think that would have been even nicer.

      Arnd

  parent reply	other threads:[~2024-10-21 10:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-18 15:11 [PATCH] drm: a6xx: avoid excessive stack usage Arnd Bergmann
2024-10-19  9:31 ` Akhil P Oommen
2024-10-19 13:14   ` Dmitry Baryshkov
2024-10-21  9:25     ` Akhil P Oommen
2024-10-21  9:31       ` Konrad Dybcio
2024-10-23 19:42         ` Akhil P Oommen
2024-10-21 10:01       ` Arnd Bergmann [this message]
2024-10-27 18:14         ` Akhil P Oommen

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=cb728358-ac32-4b37-a954-967f338385e2@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=airlied@gmail.com \
    --cc=arnd@kernel.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=justinstitt@google.com \
    --cc=konradybcio@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=marijn.suijten@somainline.org \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=quic_abhinavk@quicinc.com \
    --cc=quic_akhilpo@quicinc.com \
    --cc=robdclark@gmail.com \
    --cc=sean@poorly.run \
    --cc=simona@ffwll.ch \
    /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