From: Miquel Raynal <miquel.raynal@bootlin.com>
To: David Laight <david.laight.linux@gmail.com>
Cc: Karl Mehltretter <kmehltretter@gmail.com>,
Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Lukas Wunner <lukas@wunner.de>,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mtd: cfi_cmdset_0001: shrink do_write_buffer() stack frame
Date: Tue, 25 Aug 2026 14:35:33 +0200 [thread overview]
Message-ID: <87o6eqgyy2.fsf@bootlin.com> (raw)
In-Reply-To: <20260824085632.2dd08ba9@pumpkin> (David Laight's message of "Mon, 24 Aug 2026 08:56:32 +0100")
Hi David & Vignesh,
On 24/08/2026 at 08:56:32 +01, David Laight <david.laight.linux@gmail.com> wrote:
> On Mon, 24 Aug 2026 03:47:03 +0200
> Karl Mehltretter <kmehltretter@gmail.com> wrote:
>
>> arm32 allmodconfig fails to build with gcc:
>>
>> drivers/mtd/chips/cfi_cmdset_0001.c:1883:1: error: the frame size of 1296
>> bytes is larger than 1280 bytes [-Werror=frame-larger-than=]
>>
>> With MTD_MAP_BANK_WIDTH_32 a map_word is 32 bytes, and with KASAN_STACK
>> every temporary gets its own redzoned slot. do_write_buffer() builds a
>> map_word for each of the twelve commands it issues, and those temporaries
>> dominate its frame.
>
> Looks to me like pretty much all of mtd/map.h should be real functions
> and not #defines or inlines.
>
> The bloat from all those expansions is going to be significant.
> They only time they get optimised to anything small is when only
> CONFIG_MTD_MAP_BANK_WIDTH_1 is set.
>
> The execution time of all those that do real io (especially reads)
> will be dominated by the io access itself.
David, may I ask if you acknowledge the fix?
Vignesh, same question, maybe you also test that there is no apparent
regression?
Thanks,
Miquèl
prev parent reply other threads:[~2026-08-25 12:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-24 1:47 [PATCH] mtd: cfi_cmdset_0001: shrink do_write_buffer() stack frame Karl Mehltretter
2026-08-24 7:56 ` David Laight
2026-08-25 12:35 ` Miquel Raynal [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=87o6eqgyy2.fsf@bootlin.com \
--to=miquel.raynal@bootlin.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=david.laight.linux@gmail.com \
--cc=kmehltretter@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=lukas@wunner.de \
--cc=richard@nod.at \
--cc=vigneshr@ti.com \
/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