Re: [RFC PATCH 2/2] arm64: Implement vmalloc based thread_info allocator

From: Arnd Bergmann
Date: Mon May 25 2015 - 17:20:59 EST


On Monday 25 May 2015 19:01:33 Jungseok Lee wrote:
> On May 25, 2015, at 2:49 AM, Arnd Bergmann wrote:

> > Could the stack size be reduced to 8KB perhaps?
>
> I guess probably not.
>
> A commit, 845ad05e, says that 8KB is not enough to cover SpecWeb benchmark.
> The stack size is 16KB on x86_64. I am not sure whether all applications,
> which work fine on x86_64 machine, run very well on ARM64 with 8KB stack size.

A more interesting explanation is probably the one that led to x86
adopting 16kb pages, see https://lwn.net/Articles/600644 ,
https://lwn.net/Articles/600649/ and http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=6538b8ea88

Based on that, I have to agree that lowering the size back to 8kb seems
unrealistic at the moment, but at the same time, we need to actively
keep working on reducing the stack size. IRQ stacks are one important
point here, but in the trace that Minchan Kim has in the commit for x86-64
there is not even an interrupt.

I've looked at the code that is generated by aarch64-linux-gcc-4.8 now
and found that it does not try very hard to reduce the stack size,
the first function I fed it end up up using 48 bytes of stack where
half of that would suffice, so there is probably room for optimization
within the boundaries of the ABI, possibly more if we allow kernel
specific calling conventions as some other architectures have implemented
in the past.

Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/