Sliming down kernel and provide more as modules (Was: Re: Fedora28 / autofs&NFS)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9 April 2018 at 07:24, Peter Robinson <pbrobinson@xxxxxxxxx> wrote:
[..]
> It's also unrelated to this topic, it's (and I use it's, not they're,
> as it's one driver) built in because it makes booting faster in the
> general use case, it also makes debug and recovery easier when one of
> the core filesystems is there and you don't need to find it in an
> initrd, we also do it for other key widely used system components like
> some ATA drivers, IP stack options etc.

Just checked what is in kernel configuration and seems ATA driver IS
compiled statically into the kernel =:-o
Why? Most of the used HW more likely will be using SATA.
It would be really good to change this by:

-CONFIG_ATA=y
+CONFIG_ATA=m

Fedora on mounting initrd is using from maaaany years ramfs (not ext fs).
If you want to debug what happens on mounting even rootfs fs driver
you can use all tools which you may need packing them into initrd.
With grubby now adding such additional tools is incredibly easy thing
to do, and you don't need to have ext compiled into the kernel to
prepare such debug tooling.
You cannot use on recovery ext driver if your crashed hardware
resources does not provide any block device formatted as ext fs vol.

IPv4 support is not modularised in Linux kernel source code at all so
for now it is not an option to have or not to have IP stack in main
kernel binary like it is on for example Solaris. And yes, it would be
good to have modularise IPv4 support (like it is with IPv6) to handle
scenarios where someone is using only IPv6 but it is matter of some
serious work which needs to be done with rearchitecting few things in
Linux kernel .. not a choosing something in kernel source code
configuration only.

I've asked about reasons because I'm trying to use everywhere btrfs as
rootfs and for the people using xfs only in similar situations this
ext driver compiled into the kernel is like 1kg lead weight dangling
between the legs .. (especially on some ARM systems with only 256MB
RAM)
IMO looks like only reasons why ext still is compiled into the kernel
are related to the fact that for quite long time no one have been
trying to update kernel source code configuration files and now mamy
drivers are not even enabled as loadable modules.

Many staging drivers and especially USB HID drivers are not enabled as
well. IRDA, FPGA support is not at all enabled (even as module).
There is many things which can be now provided as module instead be
compiled in to the kernel.

Few examples after quick review:
1) gzip support in initrd is enough as grubby is using only gzip.

 CONFIG_RD_GZIP=y
-CONFIG_RD_BZIP2=y
-CONFIG_RD_LZMA=y
-CONFIG_RD_XZ=y
-CONFIG_RD_LZO=y
-CONFIG_RD_LZ4=y
+# CONFIG_RD_BZIP2 is not set
+# CONFIG_RD_LZMA is not set
+# CONFIG_RD_XZ is not set
+# CONFIG_RD_LZO is not set
+# CONFIG_RD_LZ4 is not set

2)
-CONFIG_X86_MSR=y
-CONFIG_X86_CPUID=y
+CONFIG_X86_MSR=m
+CONFIG_X86_CPUID=m

3)
-CONFIG_CPU_FREQ_GOV_POWERSAVE=y
-CONFIG_CPU_FREQ_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=m
+CONFIG_CPU_FREQ_GOV_USERSPACE=m
 CONFIG_CPU_FREQ_GOV_ONDEMAND=y
-CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m

4) I don't think that PCMCIA needs to be hardcoded in to the kernel

-CONFIG_PCCARD=y
-CONFIG_PCMCIA=y
+CONFIG_PCCARD=m
+CONFIG_PCMCIA=m

5) especially on x86* or on guest systems working inside VM
-CONFIG_REGMAP_I2C=y
-CONFIG_REGMAP_SPI=y
+CONFIG_REGMAP_I2C=m
+CONFIG_REGMAP_SPI=m

6) if someone is using only SCSI this will be useful
-CONFIG_SATA_AHCI=y
+CONFIG_SATA_AHCI=m

-CONFIG_ATA_PIIX=y
+CONFIG_ATA_PIIX=m

7)
-CONFIG_INPUT_LEDS=y
+CONFIG_INPUT_LEDS=m

-CONFIG_I2C=y
+CONFIG_I2C=m

8) If someone is using Linux working in VM or headless HW ..
-CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV=m

-CONFIG_MOUSE_PS2=y
+CONFIG_MOUSE_PS2=m

(this is useless in case guest system in VM)
-CONFIG_HWMON=y
+CONFIG_HWMON=m

-CONFIG_AGP=y
-CONFIG_AGP_AMD64=y
-CONFIG_AGP_INTEL=y
-CONFIG_AGP_SIS=y
-CONFIG_AGP_VIA=y
-CONFIG_INTEL_GTT=y
+CONFIG_AGP=m
+CONFIG_AGP_AMD64=m
+CONFIG_AGP_INTEL=m
+CONFIG_AGP_SIS=m
+CONFIG_AGP_VIA=m
+CONFIG_INTEL_GTT=m

-CONFIG_HID_GENERIC=y
+CONFIG_HID_GENERIC=m

-CONFIG_USB=y
+CONFIG_USB=m

-CONFIG_USB_MON=y
+CONFIG_USB_MON=m

-CONFIG_USB_OHCI_HCD=y
-CONFIG_USB_OHCI_HCD_PCI=y
+CONFIG_USB_OHCI_HCD=m
+CONFIG_USB_OHCI_HCD_PCI=m
-CONFIG_USB_UHCI_HCD=y
+CONFIG_USB_UHCI_HCD=m

-CONFIG_RTC_I2C_AND_SPI=y
+CONFIG_RTC_I2C_AND_SPI=m

-CONFIG_DMI_SYSFS=y
+CONFIG_DMI_SYSFS=m

Some SCSI support can be more modularised as well

-CONFIG_BLK_DEV_SD=y
+CONFIG_BLK_DEV_SD=m
-CONFIG_CHR_DEV_SG=y
+CONFIG_CHR_DEV_SG=m

9) I think that this could be modularised as well
-CONFIG_NVRAM=y
+CONFIG_NVRAM=m

10) Definitelly this can stay as module
-CONFIG_RAW_DRIVER=y
+CONFIG_RAW_DRIVER=m

11) Mentioned already ext support:
-CONFIG_EXT4_FS=y
+CONFIG_EXT4_FS=m
-CONFIG_JBD2=y
+CONFIG_JBD2=m

12) Not everyone is using quota
-CONFIG_QUOTA_TREE=y
+CONFIG_QUOTA_TREE=m

This is not probably all ..

kloczek
-- 
Tomasz Kłoczko | LinkedIn: http://lnkd.in/FXPWxH
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux