Re: Stack consumption in NPTL



llothar <llothar@xxxxxx> writes:
On 7 Mrz., 16:39, Chetan <chetan...@xxxxxxxxx> wrote:

Is this the case? Is it documented anywhere?

I asked this many times. Nobody can answer it. It is AFAIK only
specified on MacOSX where then MachTask has a 16KB kernel stack. I
wasn't even getting an answer on this list if there is a different
kernel stack and what default size it is.

'kernel stack' and 'userspace stack' are two completely unrelated
things: Because every 'usual' (NPTL, LinuxThreads) thread on
Linux-based systems is associated with a 'kernel schedulable entity'
('task', 1:1 threading), every thread has a kernel stack associated
with it, to be used while the thread is executing in the kernel. As
opposed to the userspace stack, whose pages, up to configured maximum
size, are allocated on demand, the kernel stack consumes a certain
amount of physical memory during the lifetime of the thread it belongs
to. How much depends on the kernel configuration: The defaults is 8K per
thread, with 4K per thread being selectable when configuring a kernel
source tree for compilation (for some weird reason, this is part of
'Kernel hacking/ Kernel debugging').
.



Relevant Pages

  • Interrupt context...
    ... I have been tearing my hair on interrupt architecture of linux. ... kernel stack and ISR is executed. ... What things will be setup to execute ISR? ... ISR is part of kernel, it will be executed on the kernel that was ...
    (comp.os.linux.development.system)
  • Interrupt context...
    ... I have been tearing my hair on interrupt architecture of linux. ... kernel stack and ISR is executed. ... What things will be setup to execute ISR? ... ISR is part of kernel, it will be executed on the kernel that was ...
    (comp.os.linux.misc)
  • Re: Does process need to have a kernel-side stack all the time?
    ... You are one of the experts in processes/threads and scheduling ... If your application is using tens of thousands of threads on hardware that can't spare tens of megabytes to ensure that a thread will always have a kernel stack when it needs one, ... If they're sleeping, ...
    (Linux-Kernel)
  • Re: thread memory size
    ... not need to contain too much data, as all the rest is properly set ... amount of kernel memory used by a thread (which is mostly the ... associated kernel stack, default 8K, configurable 4K) nor the problem ... But for some reason this discussion has shifted into a ...
    (comp.os.linux.development.system)
  • Re: [00/41] Large Blocksize Support V7 (adds memmap support)
    ... Slab defrag doesn't look like a solved problem. ... allocator was designed to group similar objects together. ... 100% of ram wouldn't go allocated in slub as a pure kernel stack, ... Spending 20% of ram on each of {kernel ...
    (Linux-Kernel)