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
-
Fedora 40 Beta Released Soon
With the official release of Fedora 40 coming in April, it's almost time to download the beta and see what's new.
-
New Pentesting Distribution to Compete with Kali Linux
SnoopGod is now available for your testing needs
-
Juno Computers Launches Another Linux Laptop
If you're looking for a powerhouse laptop that runs Ubuntu, the Juno Computers Neptune 17 v6 should be on your radar.
-
ZorinOS 17.1 Released, Includes Improved Windows App Support
If you need or desire to run Windows applications on Linux, there's one distribution intent on making that easier for you and its new release further improves that feature.
-
Linux Market Share Surpasses 4% for the First Time
Look out Windows and macOS, Linux is on the rise and has even topped ChromeOS to become the fourth most widely used OS around the globe.
-
KDE’s Plasma 6 Officially Available
KDE’s Plasma 6.0 "Megarelease" has happened, and it's brimming with new features, polish, and performance.
-
Latest Version of Tails Unleashed
Tails 6.0 is based on Debian 12 and includes GNOME 43.
-
KDE Announces New Slimbook V with Plenty of Power and KDE’s Plasma 6
If you're a fan of KDE Plasma, you'll be thrilled to hear they've announced a new Slimbook with an AMD CPU and the latest version of KDE Plasma desktop.
-
Monthly Sponsorship Includes Early Access to elementary OS 8
If you want to get a glimpse of what's in the pipeline for elementary OS 8, just set up a monthly sponsorship to help fund its continued existence.
-
DebConf24 to be Held in South Korea
Busan will be the location of the latest DebConf running July 28 through August 4