From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: David Laight <david.laight.linux@gmail.com>,
Lukas Wunner <lukas@wunner.de>,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH v3 1/1] mtd: cfi_cmdset_0001: Factor out do_write_buffer_locked() to reduce stack frame
Date: Tue, 28 Apr 2026 10:20:16 +0200 [thread overview]
Message-ID: <87pl3jebsv.fsf@bootlin.com> (raw)
In-Reply-To: <ae-FLk1N3wJs8sTW@ashevche-desk.local> (Andy Shevchenko's message of "Mon, 27 Apr 2026 18:47:58 +0300")
>> >> > Stack usage is high here because of the three "map_word" types,
>> >> > which can each be up to 256 unsigned longs (32 * 8), see the
>> >> > definitions of MAX_MAP_LONGS, MAX_MAP_BANKWIDTH, map_word in
>> >> > include/linux/mtd/map.h.
>> >>
>> >> Ugg - that code is horrid.
>> >> Returning structures by value isn't really a good idea.
>>
>> Looks like the primary reason for the stack over usage, no? Isn't
>> playing with inline and refactoring just a tiny fix that prevents
>> problem by just a couple of bytes?
>>
>> I haven't looked too carefully, but could we (Andy?) have a fix that
>> reduces the number of map_word (as suggested, IIUC) and/or avoid passing
>> them by value?
>
> I am not an expert for this particular change, I am afraid.
Surprising flannel from someone sorely insisting to force contributors
into doing zillions more changes than they initially wanted, easily
triggering iniquitously NACKs otherwise.
> Consider my patch
> as a bug report that needs to be addressed, Currently it might break some
> builds when `make W=1` is passed.
Hopefully you will remember that you have your own limits too. Maybe
that will allow others to breeze next time there will be something that
matters so much to you that you prefer to fully block their work.
>> I can also take this cleanup if enclosed in a bigger
>> series, I don't mind because it may make the code easier to read as
>> well, but I feel like this is not a proper fix. If it is, please explain
>> to me again :-)
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
prev parent reply other threads:[~2026-04-28 8:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-08 21:11 [PATCH v3 1/1] mtd: cfi_cmdset_0001: Factor out do_write_buffer_locked() to reduce stack frame Andy Shevchenko
2026-04-09 7:26 ` David Laight
2026-04-09 7:58 ` Lukas Wunner
2026-04-09 11:28 ` David Laight
2026-04-14 12:38 ` Andy Shevchenko
2026-04-27 15:38 ` Miquel Raynal
2026-04-27 15:47 ` Andy Shevchenko
2026-04-28 8:20 ` 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=87pl3jebsv.fsf@bootlin.com \
--to=miquel.raynal@bootlin.com \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=david.laight.linux@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