Kernel Articles From LWN

-
The end of CONFIG_ANDROID [LWN.net]
The kernel has thousands of configuration options, many of which can change the kernel's behavior in subtle or surprising ways. Among those options is CONFIG_ANDROID, which one might expect to be relatively straightforward; its description reads, in its entirety: "Enable support for various drivers needed on the Android platform". It turns out that this option does more than that, to the surprise of some users. That has led to a plan to remove this option, but that has brought a surprise or two of its own — and some disagreement — as well.
The discussion started when Alex Xu reported a read-copy-update (RCU) error that was appearing on his system after resuming from suspend. Shortly thereafter, Xu realized that the problem was tied to the fact that his kernel had been built with CONFIG_ANDROID enabled; among other things, that option significantly reduces the time that can elapse before RCU starts putting out stall warnings.
-
Removing the scheduler's energy-margin heuristic [LWN.net]
The CPU scheduler's job has never been easy; it must find a way to allocate CPU time to all tasks in the system that is fair, allows all tasks to progress, and maximizes the throughput of the system as a whole. More recently, it has been called upon to satisfy another constraint: minimizing the system's energy consumption. There is currently a patch set in circulation, posted by Vincent Donnefort with work from Dietmar Eggemann as well, that changes how this constraint is met. The actual change is small, but it illustrates how hard it can be to get the needed heuristics right.
Reduction of energy use is, of course, a worthy goal; energy that is not wasted becomes available for the mining of more cryptocurrency, after all. There are some smaller considerations as well, such as environmental benefits, that justify the effort, but the proliferation of battery-powered devices has added more urgency to the task. If batteries can be made to last longer, doomscrolling interruptions will be fewer and users will be happier.
These pressures have led to the addition of energy-aware scheduling to the kernel. When the scheduler considers the placement of tasks in the system, it will work to reduce the amount of energy consumed overall; this work includes running the CPUs at the power level that is the most efficient for the current load and powering down processors entirely when possible. For example, if a CPU that is currently running at a given power level can accept another task without having to move to a higher power level, it may make sense to move a task there from another CPU.
-
A BPF-specific memory allocator [LWN.net]
The kernel does not lack for memory allocators, so one might well question the need for yet another one. As this patch set from Alexei Starovoitov makes clear, though, the BPF subsystem feels such a need. The proposed new allocator is intended to increase the reliability of allocations made within BPF programs, which might be run in just about any execution context.
Allocating memory in the kernel can be tricky in the best of situations. Depending on the execution context at the time, the memory-management subsystem may or may not have various options available to find memory if an allocation request cannot be immediately satisfied. For example, memory can be freed by pushing its contents out to persistent storage, but if memory is requested from within a filesystem, calling back into that filesystem to write out data could cause deadlocks and is thus not an option. In many kernel contexts, it is not possible to sleep to wait for memory to become free. If the kernel is currently handling a non-maskable interrupt (NMI) from the CPU, the options are even more limited.
Most kernel code is written to run within a specific context and with an awareness of the available memory-allocation options; that information is passed to the memory-management subsystem via the GFP flags supplied with allocation requests. When a specific function can be invoked in multiple contexts, it generally must allocate memory as if it were always running in the most restrictive possible context; this can be inconvenient for developers.
Over the years, mechanisms like memory pools ("mempools"), which pre-allocate a certain amount of memory to ensure that it will be available when it is needed, have been developed to make life easier. Naturally, mempools quickly created a new problem: kernel developers adopted mempools as a way of insulating themselves from memory-allocation failures. Before long, much of the kernel's memory was tied up in mempools and unavailable where it was actually needed. Over the years, a balance has mostly been found between overenthusiastic mempool use and being unable to allocate memory in critical situations.
-
An Ubuntu kernel bug causes container crashes [LWN.net]
Some system administrators running Ubuntu 20.04 had a rough time on June 8, when Ubuntu published kernel packages containing a particularly nasty bug that was caused by an Ubuntu-specific patch to the kernel. The bug led to a kernel panic whenever a Docker container was started. Fixed packages were made available on June 10, but there are questions about what went wrong with handling the patch; in particular, it is surprising that kernel 5.13, which has been beyond its end-of-life for months, made it onto machines running Ubuntu 20.04, which is supposed to be a long-term support release.
-
The 2022 embedded Linux update [LWN.net]
A regular feature of the Embedded Linux Conference (ELC) has been an update on the state of embedded Linux from conference organizer Tim Bird. It has been quite a few years since I had the opportunity to sit in on one, so I took one at the 2022 Open Source Summit North America (OSSNA) in Austin, Texas. OSSNA is an umbrella conference that contains ELC and a whole lot more these days. Bird gave a look at recent kernel features from an embedded perspective, talked a bit about some different technology areas and their impact on embedded Linux, and also tried to answer a question that Andrew Morton posed in a keynote at ELC in 2008.
Among his many hats, Bird was the program committee chair for ELC and he is a principal software engineer at Sony Electronics. He started by saying that he was trying to squeeze a talk that he gives fairly regularly at other events down from its usual hour and a half—to 40 minutes. So he warned attendees that he would be moving fast. His goals with the talk were to introduce new technologies that have been added to the Linux kernel, so that attendees could perhaps incorporate them into their products, but also to start a conversation in the ecosystem about areas that need attention.
-
- Login or register to post comments
Printer-friendly version- 729 reads
PDF version
More in Tux Machines
- Highlights
- Front Page
- Latest Headlines
- Archive
- Recent comments
- All-Time Popular Stories
- Hot Topics
- New Members
today's howtos
| Open Hardware: XON/XOFF and Raspberry Pi Pico
|
Security Leftovers
| How to Apply Accent Colour in Ubuntu Desktop
A step-by-step tutorial on how to apply accent colour in Ubuntu desktop (GNOME) with tips for Kubuntu and others.
|



This section of TuxMachines will no longer have new stories in it (with some caveats, including this post). To see the latest stories go to

.svg_.png)
Content (where original) is available under CC-BY-SA, copyrighted by original author/s.


Recent comments
2 days 3 hours ago
2 days 7 hours ago
2 days 7 hours ago
3 days 14 hours ago
3 days 15 hours ago
3 days 16 hours ago
3 days 16 hours ago
3 days 17 hours ago
3 days 19 hours ago
3 days 21 hours ago