Zack's Kernel News
The True Meaning of EXPORT_SYMBOLS_GPL
Richard Yao asked why the LZ4 code, which was clearly under a BSD license, had its symbols included in the EXPORT_SYMBOLS_GPL code.
Matthew Garrett replied, "EXPORT_SYMBOL_GPL is intended [as] an indication that using a symbol is likely to result in you producing a derived work of the kernel, and the kernel as a whole is under the GPL. It has nothing to do with additional licenses that individual pieces of code may be available under."
Joe Perches gave a link to an interesting summary of the debate over this issue [1]. Rob Landley thought that the whole discussion was legally dangerous. He said that EXPORT_SYMBOLS_GPL
was intended to indicate when the use of kernel source code constituted a derived work (and thus when any distribution of that work would need to be licensed under the GPL). He didn't want to give the anti-GPL lawyers any ammunition to claim that anything other than that might be the case.
Joe, however, replied that Matthew's "declarative statement that EXPORT_SYMBOL_GPL is 'intended [as] an indication that using [the] symbol is likely to result … .' is incomplete. There are competing histories as to what EXPORT_SYMBOL_GPL was intended to do."
Matthew replied that the history and meaning of EXPORT_SYMBOLS_GPL
wasn't really in doubt. And there, this time, the discussion ended.
Atomic Renames
Miklos Szeredi posted a patch to add a new system call, rename2()
, to go alongside the rename()
system call. The rename()
call changes the name of a file. The rename2()
call takes two files and swaps their names, so the first ends up with the name of the second, and the second ends up with the name of the first. Eventually, Miklos would like to see the behavior of rename2()
folded into that of rename()
, but he didn't want to do that at the start because it would make the patch balloon up in size.
About his patch, he said: "This allows interesting things, which were not possible before, for example atomically replacing a directory tree with a symlink."
He added, "The other reason to introduce this is for whiteout handling in union/overlay solutions in an atomic manner without having to add complex code to each filesystem's rmdir, mkdir and rename just for handling whiteouts." A whiteout is when you have a union filesystem and want to delete a file that resides on a read-only filesystem. When you delete the file under those circumstances, the union filesystem uses a whiteout to make it look to the user as though the file has really been deleted.
He pointed out that, although most whiteout cases would be solved with rename2()
, there were still cases that wouldn't, and he mentioned that a new flag would be needed eventually to handle those remaining cases.
H. Peter Anvin suggested that instead of a simple A-to-B and B-to-A name exchange, Miklos should use a more complicated rename3()
solution that would rename A to B, but then if B already existed it would rename B to C. Peter pointed out that this would encompass Miklos's original behavior, because rename(C,B,C)
would accomplish the same file swap Miklos had envisioned.
Linus Torvalds stepped in at that point, saying that, actually, Miklos had already implemented that three-name version, but that it had been much more complicated and didn't fit as well with the rest of the API. Miklos's rename2()
was actually the simpler and more preferable revision, Linus said. He added, "I was actually very relieved to see this much simpler and cleaner model, because the alternative really was nasty. This one looks fairly simple and clean and straightforward."
Andy Lutomirski suggested adding a flag to the new system call that would prevent a rename if the destination filename already existed on the filesystem. Linus agreed that this would be good, and the thread ended there.
Speeding Up AMD Kernels
Austin Hemmelgarn posted a patch to optimize a bunch of AMD CPUs. He said, "These provide noticeable improvements over the K8 config option, and allow the kernel to take full advantage of AMD specific instruction set extensions, such as ABM, LZCNT, and POPCNT."
Borislav Petkov replied that "A patch like that keeps popping up every couple of months. Please show us those noticeable improvements because the guy last time failed to do so." Borislav added that distribution kernels always shipped with only generic CPU support, so Austin's patch, at best, would help a very small subset of users who downloaded and compiled their own kernels.
Austin asked why it was so important to show measurable speedup, if the worst-case scenario was that almost no one would use the configuration option. However, he agreed to run the tests. Borislav replied, "Just having the option for no good reason at all is a no-no." A couple of posts later, he added, "If it doesn't bring any performance improvement – and I don't want to rain on your parade but I think it won't, at least not enough to warrant a serious look – there's absolutely no reason to add it."
Austin ran a few tests using his PILEDRIVER config option and reported that "build jobs appear to be much improved. Building kernel 3.12-rc2 with allmodconfig using 8 jobs on a FX-8320 takes 22 minutes and 57 seconds on a kernel with CONFIG_MK8, 21 minutes and 35 seconds on a kernel with CONFIG_GENERIC, and 19 minutes and 11 seconds on a kernel with CONFIG_PILEDRIVER. I see similar results for a build of GCC 4.7 (45m1s, 41m39s, and 38m56s)."
He added, "I don't know about you, but that sure seems to be a worthwhile performance increase to me." Linus Torvalds replied, "That's certainly noticeable. Surprisingly so."
Linus asked if Austin had run any kernel profiling, to see exactly where the speedup occurred. Borislav also ran his own tests using Austin's PILEDRIVER option. He reported, "I don't really see any of those improvements above. Actually, -march=bdver2 is even slightly worse in comparison to mk8. And the workload is of building a config specific to that machine but allmodconfig looks very similar, the numbers being simply higher."
Austin remarked, "Part of the difference between our results may be that I have my entire userspace built with -mtune=bdver2, so less of the time is spent in userspace." He added, "With regards to the differences shown above relative to CONFIG_MK8, that does actually make sense; with CONFIG_MK8, gcc makes very minimal use of extension instructions (afaik, only MMX, SSE, and 3Dnow!), this improves performance slightly on bulldozer derivatives because there are only half as many SSE and FP units as CPU cores."
Borislav replied, "That still cannot explain the huge difference between building on a mk8 vs bdver2 kernel. Provided your userspace is the same and only the kernels are different, I don't see how that happens."
The discussion ended around there with no conclusive performance improvement shown for Austin's patch, and no conclusive disproof either. To get into the kernel, however, proof of value would be the deciding factor.
Infos
- EXPORT_SYMBOL_GPL debate summary: http://www.ifross.org/en/artikel/ongoing-dispute-over-value-exportsymbolgpl-function
« 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
-
Gnome 48 Debuts New Audio Player
To date, the audio player found within the Gnome desktop has been meh at best, but with the upcoming release that all changes.
-
Plasma 6.3 Ready for Public Beta Testing
Plasma 6.3 will ship with KDE Gear 24.12.1 and KDE Frameworks 6.10, along with some new and exciting features.
-
Budgie 10.10 Scheduled for Q1 2025 with a Surprising Desktop Update
If Budgie is your desktop environment of choice, 2025 is going to be a great year for you.
-
Firefox 134 Offers Improvements for Linux Version
Fans of Linux and Firefox rejoice, as there's a new version available that includes some handy updates.
-
Serpent OS Arrives with a New Alpha Release
After months of silence, Ikey Doherty has released a new alpha for his Serpent OS.
-
HashiCorp Cofounder Unveils Ghostty, a Linux Terminal App
Ghostty is a new Linux terminal app that's fast, feature-rich, and offers a platform-native GUI while remaining cross-platform.
-
Fedora Asahi Remix 41 Available for Apple Silicon
If you have an Apple Silicon Mac and you're hoping to install Fedora, you're in luck because the latest release supports the M1 and M2 chips.
-
Systemd Fixes Bug While Facing New Challenger in GNU Shepherd
The systemd developers have fixed a really nasty bug amid the release of the new GNU Shepherd init system.
-
AlmaLinux 10.0 Beta Released
The AlmaLinux OS Foundation has announced the availability of AlmaLinux 10.0 Beta ("Purple Lion") for all supported devices with significant changes.
-
Gnome 47.2 Now Available
Gnome 47.2 is now available for general use but don't expect much in the way of newness, as this is all about improvements and bug fixes.