From: "Arnd Bergmann" <arnd@arndb.de>
To: "Robin Murphy" <robin.murphy@arm.com>,
"Arnd Bergmann" <arnd@kernel.org>,
"Will Deacon" <will@kernel.org>,
"Mark Rutland" <mark.rutland@arm.com>,
"Nathan Chancellor" <nathan@kernel.org>
Cc: "Nick Desaulniers" <nick.desaulniers+lkml@gmail.com>,
"Bill Wendling" <morbo@google.com>,
"Justin Stitt" <justinstitt@google.com>,
"Ilkka Koskinen" <ilkka@os.amperecomputing.com>,
linux-arm-kernel@lists.infradead.org,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
llvm@lists.linux.dev
Subject: Re: [PATCH] perf/arm-cmn: reduce stack usage in arm_cmn_probe()
Date: Fri, 27 Jun 2025 20:37:53 +0200 [thread overview]
Message-ID: <0952a73f-3f3d-4531-a3ca-d68478a86e11@app.fastmail.com> (raw)
In-Reply-To: <39117e6a-ebb6-4c92-a19c-2033c4e590cd@arm.com>
On Fri, Jun 27, 2025, at 19:57, Robin Murphy wrote:
> On 20/06/2025 12:51 pm, Arnd Bergmann wrote:
>
> At that point, though, it seems like we may as well just disable the
> warning :/
I had a couple of cases like this, where the same large stack
happens on both gcc and clang, and adding noinline makes clang
behave the same way as gcc, so neither of them warns. Leaving
the warning enabled at this point at least ensures that we catch
it if it ever increases further.
There is a different type of problem (mostly on powerpc and mips,
but sometimes on arm64) where the 'noinline' helps clang to not
produce some really bad object code with unnecessary temporaries
on the stack.
> Fortunately it's not actually that hard to improve matters here, so I've
> just sent that patch:
>
> https://lore.kernel.org/r/e7dd41bf0f1b098e2e4b01ef91318a4b272abff8.1751046159.git.robin.murphy@arm.com/T/#u
Nice, your version reduces the stack size from 1360 to 784 bytes
for my test randconfig, so that's clearly better than my version.
While attempting to reproduce this now, I also found that another
patch I had avoided the warning: I added -finline-max-stacksize=128
to the KASAN cflags, to work around some overeager inlining on
powerpc, and this had the same effect as my patch, but without
actually having to modify the sources.
Arnd
prev parent reply other threads:[~2025-06-27 19:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-20 11:51 [PATCH] perf/arm-cmn: reduce stack usage in arm_cmn_probe() Arnd Bergmann
2025-06-27 17:57 ` Robin Murphy
2025-06-27 18:37 ` Arnd Bergmann [this message]
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=0952a73f-3f3d-4531-a3ca-d68478a86e11@app.fastmail.com \
--to=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=ilkka@os.amperecomputing.com \
--cc=justinstitt@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=mark.rutland@arm.com \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=nick.desaulniers+lkml@gmail.com \
--cc=robin.murphy@arm.com \
--cc=will@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