lkml.org 
[lkml]   [2021]   [Jul]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: div_u64/do_div stack size usage, was Re: [v3] block: Removed a warning while compiling with a cross compiler for parisc
Date
On 2021-07-08 7:37 a.m., Arnd Bergmann wrote:
>>> I think setting it to 2048 is rather excessive,
>> Since parisc needs roughly twice the frame (and stack) size as x86,
>> 2048 seemed logical since that's the double of what's used on x86.
>> Of course we can reduce it, e.g. to 1536.
> But it doesn't use twice as much for large functions at all. The stack
> frame for a small function is much larger, so you need a larger kernel
> stack to allow for deely nested call chains, but the frame for single
> function with large variables is only a bit larger as most of it is used up
> by those variables.
Correct.  In the 32-bit target, the stack alignment is 64 bytes.  This is the main reason functions
with small stacks use more stack than on x86.  There's also the frame marker that needs to be
reserved.  In the 64-bit target, the stack alignment is 16 bytes.  However, the minimum allocation
is quite large because of frame marker, 8 call registers and the argument pointer slots.  If a function
uses a significant number of local variables, there shouldn't be much difference in stack size.

Dave

--
John David Anglin dave.anglin@bell.net


\
 
 \ /
  Last update: 2021-07-08 17:03    [W:0.248 / U:1.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site