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
-
Linux Servers Targeted by Akira Ransomware
A group of bad actors who have already extorted $42 million have their sights set on the Linux platform.
-
TUXEDO Computers Unveils Linux Laptop Featuring AMD Ryzen CPU
This latest release is the first laptop to include the new CPU from Ryzen and Linux preinstalled.
-
XZ Gets the All-Clear
The back door xz vulnerability has been officially reverted for Fedora 40 and versions 38 and 39 were never affected.
-
Canonical Collaborates with Qualcomm on New Venture
This new joint effort is geared toward bringing Ubuntu and Ubuntu Core to Qualcomm-powered devices.
-
Kodi 21.0 Open-Source Entertainment Hub Released
After a year of development, the award-winning Kodi cross-platform, media center software is now available with many new additions and improvements.
-
Linux Usage Increases in Two Key Areas
If market share is your thing, you'll be happy to know that Linux is on the rise in two areas that, if they keep climbing, could have serious meaning for Linux's future.
-
Vulnerability Discovered in xz Libraries
An urgent alert for Fedora 40 has been posted and users should pay attention.
-
Canonical Bumps LTS Support to 12 years
If you're worried that your Ubuntu LTS release won't be supported long enough to last, Canonical has a surprise for you in the form of 12 years of security coverage.
-
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