[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <93ab94ec92497af13c563c52fc7e1f7f81dac333.camel@perches.com>
Date: Sun, 26 Jun 2022 13:39:01 -0700
From: Joe Perches <joe@...ches.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
David Laight <David.Laight@...lab.com>,
Petr Mladek <pmladek@...e.com>,
Steven Rostedt <rostedt@...dmis.org>,
Sergey Senozhatsky <senozhatsky@...omium.org>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Matthew Wilcox <willy@...radead.org>,
Miguel Ojeda <ojeda@...nel.org>,
Kent Overstreet <kent.overstreet@...il.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
LKML <linux-kernel@...r.kernel.org>,
linux-mm <linux-mm@...ck.org>
Subject: Re: [RFC[ Alloc in vsprintf
On Sun, 2022-06-26 at 13:19 -0700, Linus Torvalds wrote:
> On Sun, Jun 26, 2022 at 12:53 PM Joe Perches <joe@...ches.com> wrote:
> >
> > In a reply to the printbufs thread, I wrote a proposal to use an
> > alloc to reduce stack in vsprintf when CONFIG_KALLSYMS is enabled.
> >
> > No one has replied to this but I think it's somewhat sensible.
>
> I think that's a bad idea.
Somewhat sensible not sensible...
> Those things are *literally* called from panic situations, which may
> be while holding core memory allocation locks, or similar.
True, and special_hex_number was used on alloc failure.
> Now, you are correct that the stack buffer is annoying. But I think
> the proper way to fix that is to say "we already *have* the target
> buffer, let's use it".
OK, and that's true for all the temp stack buffers in every %p<foo>.
> That does require teaching the sprint_symbol() functions that they
> need to take a "length of buffer" and return how much they used, but
> that would seem to be a sensible thing anyway, and what the code
> should always have done?
Unnecessary stack and/or unnecessary buffers for printbufs are
just unnecessary.
> It's bad policy to just pass in a buffer without length, and I think
> it was always broken. Nasty. That KSYM_SYMBOL_LEN is magically taking
> care of it all, but it's ugly as heck, wouldn't you say?
Yup.
Powered by blists - more mailing lists