Messages in this thread | | | Subject | Re: [PATCH -next] lib/vsprintf: Make function pointer_string static | From | Joe Perches <> | Date | Mon, 29 Apr 2019 09:42:30 -0700 |
| |
On Mon, 2019-04-29 at 10:39 -0400, Steven Rostedt wrote: > [ added Joe ] > > Good question. I have just double checked it. And pointer_string() with > > "noinline_for_stack" does not make any difference in the stack > > usage here. > > > > I actually played with this before: > > > > "noinline_for_stack" is a black magic added by > > the commit cf3b429b03e827c7180 ("vsprintf.c: use noinline_for_stack"). > > From what I understand, "noinline_for_stack" is just noinline and the > "for_stack" part is just to document that the noinline is used for > stack purposes. If the compiler doesn't inline the function without the > noinline, then it wont make any difference. > > The point was to not inline the function because it can be used in > stack critical areas, and that it's better to do the call than to > increase the stack.
It was added because of %pV is recursive and recursive functions can eat a lot of stack.
Using noinline_for_stack was just a bit more self-documenting.
I do still think it's a useful notation.
| |