public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Wei Liu' <wei.liu@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Naresh Kamboju <naresh.kamboju@linaro.org>,
	Mathias Nyman <mathias.nyman@intel.com>,
	Johannes Berg <johannes@sipsolutions.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Brendan Higgins <brendanhiggins@google.com>,
	Ariel Elior <aelior@marvell.com>,
	"GR-everest-linux-l2@marvell.com"
	<GR-everest-linux-l2@marvell.com>,
	"Linux ARM" <linux-arm-kernel@lists.infradead.org>,
	open list <linux-kernel@vger.kernel.org>,
	Netdev <netdev@vger.kernel.org>,
	"lkft-triage@lists.linaro.org" <lkft-triage@lists.linaro.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"David S. Miller" <davem@davemloft.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Nathan Chancellor <nathan@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Alexei Starovoitov <ast@kernel.org>,
	Eric Dumazet <edumazet@google.com>
Subject: RE: ipv4/tcp.c:4234:1: error: the frame size of 1152 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
Date: Wed, 8 Sep 2021 16:05:12 +0000	[thread overview]
Message-ID: <e8d16a01fd3144f1b57faae59f991579@AcuMS.aculab.com> (raw)
In-Reply-To: <20210908152351.asln63jxk43xffib@liuwe-devbox-debian-v2>

From: Wei Liu
> Sent: 08 September 2021 16:24
> 
> On Wed, Sep 08, 2021 at 02:51:21PM +0000, David Laight wrote:
> > From: Wei Liu
> > > Sent: 08 September 2021 11:03
> > ...
> > > However calling into the allocator from that IPI path seems very heavy
> > > weight. I will discuss with fellow engineers on how to fix it properly.
> >
> > Isn't the IPI code something that is likely to get called
> > when a lot of stack has already been used?
> >
> > So you really shouldn't be using much stack at all??
> 
> I don't follow your questions. I don't dispute there is a problem. I
> just think calling into the allocator is not a good idea in that
> particular piece of code we need to fix.
> 
> Hopefully we can come up with a solution to remove need for a cpumask in
> that code -- discussion is on-going.

I'm pretty sure the IPI interrupt is high priority so can
nest with another interrupt.
(You certainly want it to be that way.)

So the kernel may already be running on the interrupt stack.
If the interrupted ISR code has used a lot of stack then
there may not be as much left as you might expect.

Many years ago (nearly 40!) I wrote something that did static
stack depth analysis for an embedded system.
Since there were no (interesting) indirect calls an no recursion
it wasn't completely impossible.
What it showed was that the deepest stack use was in error
trace paths that probably never happened.
I suspect the same is true for Linux - the deepest points
will be inside printk() in obscure error paths.
Get an IPI while in a printk() from deep inside an ISR
and you may not have the amount of stack you expect.

It might be possible to use the clang 'control flow integrity'
information to determine the actual maximum stack use even
for indirectly called functions.
I suspect that would be an eye-opener....

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


  reply	other threads:[~2021-09-08 16:05 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-06 12:27 ipv4/tcp.c:4234:1: error: the frame size of 1152 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] Naresh Kamboju
2021-09-07 22:16 ` Linus Torvalds
2021-09-07 23:14   ` Linus Torvalds
2021-09-07 23:35     ` Nathan Chancellor
2021-09-07 23:49       ` Linus Torvalds
2021-09-08  0:15         ` Nathan Chancellor
2021-09-08  1:35           ` Linus Torvalds
2021-09-08  1:43             ` Linus Torvalds
2021-09-08 17:00               ` Arnd Bergmann
2021-09-08  7:09     ` Johannes Berg
2021-09-08 10:03     ` Wei Liu
2021-09-08 14:51       ` David Laight
2021-09-08 15:23         ` Wei Liu
2021-09-08 16:05           ` David Laight [this message]
2021-09-08 15:59       ` Linus Torvalds
2021-09-08 16:12         ` Wei Liu
2021-09-08 13:48     ` Thorsten Glaser
2021-09-08 14:50       ` Eric Dumazet
2021-09-08 15:48         ` Linus Torvalds
2021-09-08 16:56           ` Arnd Bergmann
2021-09-08 14:11     ` Shuah Khan
2021-09-08 17:05       ` Arnd Bergmann
2021-09-08 17:16         ` Shuah Khan
2021-09-08 21:24           ` Brendan Higgins
2021-09-08 22:27             ` Linus Torvalds
2021-09-13 20:55             ` Shuah Khan
2021-09-14 20:46               ` Brendan Higgins
2021-09-14 22:03                 ` Arnd Bergmann
2021-09-17  5:39                   ` Brendan Higgins
2021-09-17  6:16                     ` Brendan Higgins
2021-09-17  7:20                       ` Arnd Bergmann

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=e8d16a01fd3144f1b57faae59f991579@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=GR-everest-linux-l2@marvell.com \
    --cc=aelior@marvell.com \
    --cc=arnd@arndb.de \
    --cc=ast@kernel.org \
    --cc=brendanhiggins@google.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=johannes@sipsolutions.net \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkft-triage@lists.linaro.org \
    --cc=mathias.nyman@intel.com \
    --cc=naresh.kamboju@linaro.org \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=torvalds@linux-foundation.org \
    --cc=wei.liu@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