Zack's Kernel News
Speeding Up Boot-Time
Nathan Zimmer noticed that on large-memory systems, booting up could take more than an hour, just due to initializing memory. He posted a patch written by himself and Mike Travis, which would cause the CPUs to start up first – that way the memory initialization could be offloaded to multiple CPUs at the same time, thus speeding up the whole process.
Greg Kroah-Hartman replied, pointing out that Nathan and Mike had made this patch a configuration option. But, Greg said, there really wasn't any reason to make it optional, because it was a pure win. Surely no one would ever choose to have a slower system for no reason.
H. Peter Anvin joined Greg in that assessment, saying that probably any system with more than a certain amount of memory – Peter guessed 128GB – would want to enable this feature by default.
Peter also wanted to know how much code this patch added to the kernel. Nathan said it was only about 400 lines of source code, but Peter clarified – he meant he was curious how many bytes of machine code the patch would add to the actual binary. To which Nathan said it was about 32KB. Peter was surprised that the patch could really be that large. He said, "Is this init code? 32K of unconditional runtime addition isn't completely trivial." Nathan replied that perhaps 24KB of it was real run-time code.
There was some back-and-forth about alternative implementations for Nathan's and Mike's idea. Yinghai Lu had some ideas, and Ingo Molnár had a proposal for a whole different concept that relied on the "buddy allocator" – a mechanism of dividing up system memory into easily handled chunks.
One way or another, though, this feature will soon be accepted into the official tree. Whether Nathan's and Mike's patch gets in, or something by Ingo, the patch will be implemented somehow. The speedup is simply too great to ignore.
Named Anonymous Memory
Colin Cross felt that certain features were just languishing in linux-next, and he wanted to see them migrate into the official tree, if possible. Specifically, ashmem
(Android Shared Memory) had some very cool features. Among them, Colin said, were the features implementing various types of anonymous memory.
Colin especially liked "named" anonymous memory – a region of memory that would show up as a file in /proc/pid/maps
. He said, "The Dalvik VM likes to use this feature extensively, even for memory that will never be shared and could easily be allocated using an anonymous mmap, and even malloc has used it in the past. It provides an easy way to collate memory used for different purposes across multiple processes, which Android uses for its 'dumpsys meminfo' and 'librank' tools to determine how much memory is used for java heaps, JIT caches, native mallocs, etc."
In addition to migrating the code out of linux-next, Colin wanted to enhance it with new system calls and other behaviors to make it more generally useful.
Christoph Hellwig was not convinced that this feature was really valuable, though. He didn't see "what ashmem buys over a shared mmap of /dev/zero." Colin replied, "ashmem ties the memory to an fd, so it can be passed to another process and mmaped to get to the same memory, but /dev/zero does not. Passing a /dev/zero fd and mmaping it would result in a brand new region of zeroed memory. Opening a tmpfs file would allow sharing memory by passing the fd, but we don't want a world-writable tmpfs."
At this point, Christoph said he was surprised that /dev/zero
didn't already do what Colin attributed to ashmem – but after looking at the /dev/zero
code, he had to affirm that ashmem represented something new.
Alex Elsayed joined the discussion, as did John Stultz, and proceeded to explore implementation details with Colin. A solid design didn't emerge in the discussion, but it seems as though at least in theory, ashmem may have some valuable qualities, worth migrating out of linux-next and into the main tree.
Zack Brown
The Linux kernel mailing list comprises the core of Linux development activities. Traffic volumes are immense, often reaching 10,000 messages in a week, and keeping up to date with the entire scope of development is a virtually impossible task for one person. One of the few brave souls to take on this task is Zack Brown.
« Previous 1 2
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
![Learn More](https://www.linux-magazine.com/var/linux_magazin/storage/images/media/linux-magazine-eng-us/images/misc/learn-more/834592-1-eng-US/Learn-More_medium.png)
News
-
NVIDIA Released Driver for Upcoming NVIDIA 560 GPU for Linux
Not only has NVIDIA released the driver for its upcoming CPU series, it's the first release that defaults to using open-source GPU kernel modules.
-
OpenMandriva Lx 24.07 Released
If you’re into rolling release Linux distributions, OpenMandriva ROME has a new snapshot with a new kernel.
-
Kernel 6.10 Available for General Usage
Linus Torvalds has released the 6.10 kernel and it includes significant performance increases for Intel Core hybrid systems and more.
-
TUXEDO Computers Releases InfinityBook Pro 14 Gen9 Laptop
Sporting either AMD or Intel CPUs, the TUXEDO InfinityBook Pro 14 is an extremely compact, lightweight, sturdy powerhouse.
-
Google Extends Support for Linux Kernels Used for Android
Because the LTS Linux kernel releases are so important to Android, Google has decided to extend the support period beyond that offered by the kernel development team.
-
Linux Mint 22 Stable Delayed
If you're anxious about getting your hands on the stable release of Linux Mint 22, it looks as if you're going to have to wait a bit longer.
-
Nitrux 3.5.1 Available for Install
The latest version of the immutable, systemd-free distribution includes an updated kernel and NVIDIA driver.
-
Debian 12.6 Released with Plenty of Bug Fixes and Updates
The sixth update to Debian "Bookworm" is all about security mitigations and making adjustments for some "serious problems."
-
Canonical Offers 12-Year LTS for Open Source Docker Images
Canonical is expanding its LTS offering to reach beyond the DEB packages with a new distro-less Docker image.
-
Plasma Desktop 6.1 Released with Several Enhancements
If you're a fan of Plasma Desktop, you should be excited about this new point release.