An idle Android phone can keep more than 5000 threads alive and, under load, come close to 100 MiB spent on kernel stacks alone (memory occupied by the kernel). Each thread sets aside about 16 KB fixed, even though it almost never uses half of it. That is why Will Deacon, who maintains arm64 alongside Catalin Marinas, brought that tally to the memory management microconference at the Linux Plumbers Conference 2026, held in Prague on October 5 this year.
The trigger for this review is not technical, it is something far more global: the contract price of conventional DRAM is rising between 10% and 15% in the fourth quarter of 2026, and TrendForce attributes it to artificial intelligence servers hoarding production.
With memory scarce again, each task's stack returned to the list of cuts. The math scales fast: ten thousand threads with a 16 KB stack are 160 MB of fixed memory, impossible to page out or share, and fleets with millions of threads pay for it in petabytes. Trimming that block touches each architecture's exception entry code, where a miscalculation ends in a system panic.
One stack per task, 16 KB each
The Linux kernel does not share a single stack across all processes. Each thread gets a private block that it uses while running privileged code and that is freed when it dies. On x86-64 that block is four 4 KB pages, that is 16 KB, and the kernel documentation fixes it at THREAD_SIZE, four times the page size. On arm64 the value has been the same since 2013.
That space is not only reserved, it is also pinned. Stacks are allocated with double alignment and, when mapped in virtual memory, a guard page separates one from another, so overshooting is detected on the spot.
A thread blocked waiting on a socket keeps its entire stack. Hence the figure Deacon brought to the room and that appears in the abstract of his talk at the Linux Plumbers Conference 2026: between 2000 and 3000 system threads plus thousands of user threads on a recent Android, with more than 5000 at rest and around 100 MiB committed to stacks when the device is working. Most of that space is never touched, and that is where the waste lies.
From 8 KB to 16 KB and the attempt to go back
The arm64 that was merged in version 3.7 of the kernel, in 2012, started with 8 KB stacks. In July 2013, on the way to 3.11, the size rose to 16 KB with a terse justification in the changelog: failures running the SpecWeb test. There is no mailing list thread discussing it, according to the archaeology Deacon himself showed in his slides. x86 raised it in 3.16, in 2014, and since then every thread pays the same on both architectures.
Then came two improvements that did not change the size, but did change the damage of an overflow. 4.5, in 2016, gave each CPU its own stack for interrupts. 4.14, in 2017, mapped the stacks in virtual memory, so that overshooting triggers a controlled fault instead of writing over someone else's memory.
Showing the evidence
The size test the speaker showed in Prague leaves the problem unvarnished. He measured four steps on Android and none of the four comes free, not even the one used today:
- 4 KB ends in a boot failure during driver initialization, before the system gets anywhere.
- 8 KB passes QEMU, the kernel build and the Android test suites, but blows up in direct reclaim under memory pressure.
- 12 KB is not supported with stacks mapped in virtual memory, so that intermediate step does not exist today.
- 16 KB passes every test in exchange for poor utilization, with pages set aside that almost nobody touches.
That order decides the discussion. The problematic step is not boot or normal work, but direct reclaim, a path that can end up calling into a filesystem and the block layer with very little headroom and nowhere to grow. The panic trace shows it: the stack runs out inside a page fault, while the kernel tries to free memory to handle another one.
The alternatives Deacon put on the table
Four paths were left on the table in the discussion, and none is a simple constant change in a header file. The list the speaker brought to the session page includes this:
- Reopen the 2013 decision and drop to 8 KB, now that direct reclaim can run on a kernel thread and free up the stack of whoever is requesting memory.
- Set the size at boot with a command-line parameter, the route of a series by Mostafa Saleh that also enables 12 KB stacks.
- Change the size per task, so that only those who really need the extra space on their worst path pay for it.
- Expose the setting to user space, so that Android or a distribution can choose it without patching the tree.
The fifth path was not on that list but was in the history. Pasha Tatashin proposed in February 2024 dynamic stacks that start at 4 KB and grow on a page fault, and the scheme ran into two walls that still stand. The first is the exception entry code, which must switch stacks without leaving half-finished states right when it is handling the exception. The second is that the kernel would have to reserve memory from any context, including one with no stack available to ask for it.
Attacking the problem from another angle
That is why the recent work attacks the problem from another angle. Deacon is behind a series of 21 patches that moves the current task pointer to TPIDRRO_ELO, points SP_ELO at the overflow stack and ends up swapping both, with a dedicated exception stack. It does not save a single byte on its own. What it does is prepare the ground for choosing the size at runtime, something impossible while the entry code assumes a fixed-size stack.
Manufacturers already tried it on their own. Several dynamic stack implementations live out of tree on Android phones, are invasive and do not fit the generic kernel's customization hooks. Deacon summed it up in the talk abstract with a simple idea: find an upstream alternative so that everyone stops carrying the broken code in their pocket.
Who has to foot the bill
The first casualty is the phone, where memory has become more expensive than the rest of the components. Trimming 8 KB per thread would return about 40 MB on a device with 5000 threads, space that is noticeable when the system kills processes under pressure.
In the cloud the saving is measured on another scale, because a fleet with millions of dedicated threads pays for pages that are never touched for the duration of the memory contract. The same price pressure reaches anyone running a server at home, where RAM now decides the budget of a self-hosting setup long before the processor.
The calendar does not favor a quick answer either. The 7.4 merge window has been open since the release of 7.3 on October 18 and has already absorbed 6753 changes not counting merges, so none of these series is in. Whatever is decided now will land, at the earliest, in the next cycle.
None of the series on the table saves memory on its own, and the effective size will keep depending on a build that gets bumped every time someone trips over it in their environment. Changing that logic requires convincing the maintainers that a configurable stack will not become a new source of panics.
An 8 KB that returns to the table
The session closed without a decision and with open questions, among them whether the interest also exists on x86 and how to measure the real use of stacks in production. The floor of the problem remains the same, because a size chosen by a 2013 test governs every thread in the system.
If the cut comes, it will come with the price of DRAM as the argument and with an uncomfortable condition. Every kilobyte removed from the stack is a potential panic on a path nobody exercised, and the saving is measured in megabytes per device while the failure is measured in devices that do not boot.