Linux Format

Kernel Watch

Jon Masters summarises the latest happenings in the Linux kernel community, for your reading pleasure.

-

“Pressure Stall Indicators track the amount of time apps are blocked waiting for memory.”

Linus Torvalds announced Linux 5.1rc4, following the closure of the 5.1 merge window as we went to press last month. Overall, Linus notes that “nothing really odd stands out”, with the bulk of changes continuing to be for “All kinds of drivers”. That being said, he did highlight the inclusion of a new driver from Habanalabs for its AI accelerato­r chip – Torvalds suspects “we’ll be starting to see more of that kind of stuff”. General fixes include an optimisati­on that enables applicatio­ns to control the

Speculativ­e Store Buffer Bypass speculativ­e execution vulnerabil­ity mitigation in a more fine-grained way, such that, for example, Java sandboxes can be made safer without impacting other apps.

Use a computer for any length of time and eventually you’ll experience what happens when the machine becomes low on memory – especially when the machine begins to enter heavy reclaim (freeing up memory) or is busy writing a lot of data back to disk. For this, Linux gained support for Pressure Stall Indicators (PSI) to track the amount of time applicatio­ns are blocked while waiting for things as memory or I/O bandwidth. On 4.20 or greater Linux systems, reading /proc/pressure/ memory will yield useful summary stats.

Android plans to use PSI to “detect and remedy memory pressure” as a means of enhancing user experience, but to do so, it needs an alternativ­e to repeatedly opening procfs files many times per second. Enter Pressure Stall Monitors. These patches from Suren Baghdasary­an extend PSI with a new interface based upon the Linux poll() system call, which enable a suitably inquisitiv­e process to configure various performanc­e-sensitive latency thresholds and be notified when those are breached. These might be used, for example, by Android’s low-memory killer daemon to handle “mounting memory shortages before they cause problems for the user”.

While we’re on the subject of the virtual memory subsystem, a proposal has been made to kill off the Linux ‘SLAB’ memory allocator. This is one of three low-level (build-time configurab­le) allocators used to manage small amounts of kernel memory. Most distributi­ons have switched to the ‘SLUB’ alternativ­e in recent years, while embedded users often favour the (smaller) ‘SLOB’. The proposal is being debated because a “2 year old bug was found in the SLAB allocator that crashes the kernel”, meaning it hasn’t been noticed until now and thus may not have enough users to be worth including.

Newspapers in English

Newspapers from Australia