5 ms·
Not necessarily directly related to this article, but with Linux adoption among OEMs exploding recently, doesn't this just continue to grow the size of the kern
by nazgulsenpai 6y ago
Not necessarily directly related to this article, but with Linux adoption among OEMs exploding recently, doesn't this just continue to grow the size of the kernel? What keeps it from becoming an even bigger monolithic behemoth than it is now? Trimming out old/unmaintained drivers?
This is just something that's never crossed my mind until glancing at this article and thinking back to Microsoft adding all of their Hyper-V/DX12 stuff.
- tenebrisalietum 6y agoDrivers are typically built as modules in Linux. Under a running kernel, they don't exist in RAM unless loaded. They aren't typically loaded except by a hardware detection process or manually.
- m463 6y agoWhen I first played around compiling the linux kernel, I found that most of it is like a suburban garage, with a kayak and a brake bleeder and a hoe and golf clubs. Except the kernel puts the suburban garage to shame. My kernel config shows: CONFIG_HAMRADIO=y CONFIG_BAYCOM_SER_FDX=m (from AX.25 network device drivers) CONFIG_CAN_SJA1000=m (from CAN device drivers) CONFIG_NFC_MRVL=m (from Near Field Communication (NFC) devices) after a while I just scroll faster and faster zooming past: CONFIG_VMWARE_BALLOON=m CONFIG_HABANA_AI=m CONFIG_MACINTOSH_DRIVERS=y CONFIG_HAPPYMEAL=m ...and loadable module support for 4 heart rate monitors, 18 inertial measurement units and 18 magnetometer sensors. Even 2 VME bridge drivers. There are 11,018 lines of this. =y means it's compiled into the kernel =m means it's a loadable module (but still takes up some kernel memory and more on disk as a .ko)
- duskwuff 6y ago> =m means it's a loadable module (but still takes up some kernel memory and more on disk as a .ko) Loadable modules are not present in memory, in any form, until they are loaded. Building them has no impact on kernel memory usage. (Consider that it's possible to build the kernel with all the modules set to "n", then switch the modules to "m" and build them afterwards. The resulting kernel is identical, save for having a slightly different embedded .config.)
- m463 6y agoI'm sorry, I stand corrected, thanks for clarifying. For some reason I thought there was a stub but maybe modprobe is smart and keeps things tidy.
- jnurmine 6y agoThere's a lot of stuff. And the reason is that distributions usually build in support for a large amount of diverse hardware. These are modules (=m) where possible. The motivation for this is: when you have that heart rate monitor, intertial measurement unit, magnetometer or something else, you just plug it in, the module gets loaded and the device just works. Some things have to be =y and are unable to support =m. To tidy up the garage, build a custom kernel and be loose with the use of =n.
- ploxiln 6y agoTrue, but you would be surprised how little space each driver and feature take. The old and obscure ones are particularly tiny and efficiently implemented by modern standards. For the latest 5.4.z kernel release, the full source tarball, xz-compressed, is 105 MB. The fairly full-featured ubuntu build is smaller: Package: linux-image-5.4.0-52-generic Installed-Size: 11.7 MB Download-Size: 8887 kB Package: linux-modules-5.4.0-52-generic Installed-Size: 73.3 MB Download-Size: 14.5 MB Now compare to, say, the smallest Windows container image you can find, or AMD or NVidia graphics driver installers ...
- nazgulsenpai 6y agoI thought CONFIG_HAPPYMEAL was a joke until I googled it :) This answers my question, thank you!