From: Nathan Chancellor <nathan@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: 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, Wei Liu <wei.liu@kernel.org>,
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, Arnd Bergmann <arnd@arndb.de>,
"David S. Miller" <davem@davemloft.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Nick Desaulniers <ndesaulniers@google.com>,
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: Tue, 7 Sep 2021 17:15:26 -0700 [thread overview]
Message-ID: <a2c18c6b-ff13-a887-dd52-4f0aeeb25c27@kernel.org> (raw)
In-Reply-To: <CAHk-=wiynwuneR4EbUNtd2_yNT_DR0VQhUF1QOZ352D-NOncjQ@mail.gmail.com>
On 9/7/2021 4:49 PM, Linus Torvalds wrote:
> On Tue, Sep 7, 2021 at 4:35 PM Nathan Chancellor <nathan@kernel.org> wrote:
>>
>> Won't your example only fix the issue with CONFIG_CPUMASK_OFFSTACK=y
>
> Yes, but..
>
>> or am I misreading the gigantic comment in include/linux/cpumask.h?
>
> you're not misreading the comment, but you are missing this important fact:
>
> config NR_CPUS_RANGE_END
> int
> depends on X86_64
> default 8192 if SMP && CPUMASK_OFFSTACK
> default 512 if SMP && !CPUMASK_OFFSTACK
> default 1 if !SMP
>
> so basically you can't choose more than 512 CPU's unless
> CPUMASK_OFFSTACK is set.
>
> Of course, we may have some bug in the Kconfig elsewhere, and I didn't
> check other architectures. So maybe there's some way to work around
> it.
Ah, okay, that is an x86-only limitation so I missed it. I do not think
there is any bug with that Kconfig logic but it is only used on x86.
> But basically the rule is that CPUMASK_OFFSTACK and NR_CPUS are linked.
>
> That linkage is admittedly a bit hidden and much too subtle. I think
> the only real reason why it's done that way is because people wanted
> to do test builds with CPUMASK_OFFSTACK even without having to have
> some ludicrous number of NR_CPUS.
>
> You'll notice that the question "CPUMASK_OFFSTACK" is only enabled if
> DEBUG_PER_CPU_MAPS is true.
>
> That whole "for debugging" reason made more sense a decade ago when
> this was all new and fancy.
>
> It might make more sense to do that very explicitly, and make
> CPUMASK_OFFSTACK be just something like
>
> config NR_CPUS_RANGE_END
> def_bool NR_CPUS <= 512
>
> and get rid of the subtlety and choice in the matter.
Indeed. Grepping around the tree, I see that arc, arm64, ia64, powerpc,
and sparc64 all support NR_CPUS up to 4096 (8192 for PPC) but none of
them select CPUMASK_OFFSTACK so it seems like they should test support
for CPUMASK_OFFSTACK and adopt similar logic to x86 to limit how much
stack space cpumask variables can use. Like you mentioned, it probably
has not come up before because most of those are 64-bit platforms that
have a higher default FRAME_WARN value (and the default NR_CPUS values
on all of them is small). I only noticed because Fedora sets NR_CPUS to
4096 for arm64 and has a FRAME_WARN value of 1024, meaning two cpumask
variables in the same frame puts that frame right at the 1024 limit.
Cheers,
Nathan
next prev parent reply other threads:[~2021-09-08 0:15 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 [this message]
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
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=a2c18c6b-ff13-a887-dd52-4f0aeeb25c27@kernel.org \
--to=nathan@kernel.org \
--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=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