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.
News
-
AlmaLinux OS Kitten 10 Gives Power Users a Sneak Preview
If you're looking to kick the tires of AlmaLinux's upstream version, the developers have a purrfect solution.
-
Gnome 47.1 Released with a Few Fixes
The latest release of the Gnome desktop is all about fixing a few nagging issues and not about bringing new features into the mix.
-
System76 Unveils an Ampere-Powered Thelio Desktop
If you're looking for a new desktop system for developing autonomous driving and software-defined vehicle solutions. System76 has you covered.
-
VirtualBox 7.1.4 Includes Initial Support for Linux kernel 6.12
The latest version of VirtualBox has arrived and it not only adds initial support for kernel 6.12 but another feature that will make using the virtual machine tool much easier.
-
New Slimbook EVO with Raw AMD Ryzen Power
If you're looking for serious power in a 14" ultrabook that is powered by Linux, Slimbook has just the thing for you.
-
The Gnome Foundation Struggling to Stay Afloat
The foundation behind the Gnome desktop environment is having to go through some serious belt-tightening due to continued financial problems.
-
Thousands of Linux Servers Infected with Stealth Malware Since 2021
Perfctl is capable of remaining undetected, which makes it dangerous and hard to mitigate.
-
Halcyon Creates Anti-Ransomware Protection for Linux
As more Linux systems are targeted by ransomware, Halcyon is stepping up its protection.
-
Valve and Arch Linux Announce Collaboration
Valve and Arch have come together for two projects that will have a serious impact on the Linux distribution.
-
Hacker Successfully Runs Linux on a CPU from the Early ‘70s
From the office of "Look what I can do," Dmitry Grinberg was able to get Linux running on a processor that was created in 1971.