A proposal was posted this week to the Linux kernel mailing list by a Google engineer to make it easier for ARM64 Linux to adjust the kernel stack size. The motivation for doing so to configure the kernel stack size during boot time is on reducing system memory consumption. Google's Mostafa Saleh posted a request for comments (RFC) to the Linux kernel mailing list with a set of 15 patches that would allow optionally setting the kernel stack size from the command line. This would make it easy to adjust the kernel stack size without having to rebuild the kernel. By more easily adjusting the kernel stack size they can avoid memory waste, especially on Android and other environments. The proposal notes: "On some systems (specifically, Android), this provides a mechanism to reduce the kernel memory consumption, as the default kernel stack size of 16kB (with 4kB pages) can result in ~100MB of allocated memory, despite the fact that most threads do not come close to exhausting their allocation." As part of this work is also allowing a 12kB stack size too if needing more than 8kB but less than the 16kB default. Another idea to potentially be pursued is allowing per-task stack sizes for helping to reduce memory usage depending upon the task. With these patches, the stack size could be adjusted via the kernel_stack_pages= option at boot time. For now at least it's an ARM64 only proposal. The topic will be discussed further next week at the Linux Plumbers Conference. Those wishing to learn more can see this RFC patch series.
Proposal To Set ARM64 Kernel Stack Size At Boot Time To Reduce Memory Consumption
Full Article
Original Source
Read the full article at Phoronix →KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.