Kernel Small Stacks Here is some random information about small
kernel stack sizes. The default stack size for a process running
in kernel space is 8K (as of 2011). There used to be an option
on x86 to reduce the stack size to 4K. And indeed there were
efforts in 2006 to make this the default stack size. However,
using a small stack opens up the dangerous possibility that the
stack will overflow, causing a kernel hang. Besides wasting
memory, if the stack space is not really needed, 8K stacks also
have an effect on, and are affected by, general kernel memory
allocation. To create an 8K stack requires an order-1
allocation, meaning that 2 contiguous physical pages must be
allocated together in order to create a new process stack. If
memory has become fragmented, it may be impossible to fulfill an
order-1 allocation, even though individual pages of physical
memory may be free. Thus 4K stack allocations (order-0
allocations) are more likely to succeed. This is important for
systems operating under extreme memory