5–7 Oct 2026
Europe/Prague timezone

Reducing kernel stack memory (on arm64)

Not scheduled
20m
Kernel Memory Management MC Kernel Memory Management MC

Speaker

Will Deacon

Description

There have been a bunch of attempts [1] to reduce the memory consumed by kernel stacks for x86 and arm64, largely based around the idea of dynamically growing the kernel stack allocation based on page faults. This poses what appear to be insurmountable challenges, as it introduces complexity into the architecture exception entry code (which needs to be able to transition cleanly to a new stack) but also means that the kernel must be able to allocate memory from any context at all.

I would like to discuss and explore alternatives to dynamic stack allocation based on some initial rework I have started of the arm64 exception entry code[2]. Specifically:

  • Revisiting the decision to move from 8k to 16k stacks
  • Changing the kernel stack size at boot time
  • Changing the kernel stack size per task
  • Controlling the kernel stack size from userspace

I think it would also be useful to talk briefly about the sticking points with dynamic kernel stacks and whether there is anything that can be carried forward from that work.

My motivation is based on Android vendors having various out-of-tree implementations of the dynamic kernel stack series and I would like to see if there are alternatives that we can provide upstream so that we can all stop carrying the broken stuff around in our pockets.

[1] https://lore.kernel.org/all/20260424191456.2679717-1-stevensd@google.com/
[2] https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git/log/?h=overflow-stack

Author

Presentation materials

There are no materials yet.