User Tools

Site Tools


projects

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
projects [2014-10-20 04:03]
joshtriplett Add a new project to compile out supplementary GIDs.
projects [2017-06-13 22:27] (current)
joshtriplett New project: eliminate unused printing code
Line 1: Line 1:
 ====== Small projects ====== ====== Small projects ======
  
-  * Make individual syscalls or groups of syscalls optional. See the [[syscalls]] page for a list of syscalls that can't currently be compiled out.  (Note that in most cases you'll want to compile out the underlying kernel functionality exposed by those syscalls; if that functionality is not already optional, this will likely turn into a large project.)+  * Make individual syscalls or groups of syscalls optional. See the [[syscalls]] page for a list of syscalls that can't currently be compiled out.  (Note that in most cases you'll want to compile out the underlying kernel functionality exposed by those syscalls; if that functionality is not already optional, this will likely turn into a large project.  Also, you do not need to add a Kconfig option for each syscall; you can group a related family of syscalls under one option, especially if they all depend on the same infrastructure.) 
 +    * In progress: sendfile, splice/​vmsplice,​ tee, adjtime/​adjtimex,​ iopl, ioperm, pivot_root, prctl 
 +    * Good targets: renameat2
   * Look at the directories and built-in.o files that show up in a tinyconfig build, and check for directories where all of the code depends (directly or indirectly) on a single configuration symbol. ​ (''​find -name built-in.o -size 8c''​ will find built-in.o files that contain no code.) in the Makefile for the parent directory, change obj-y to obj-$(CONFIG_THAT_SYMBOL),​ to stop the build system from recursing into that directory at all.  This doesn'​t directly make the kernel smaller, but makes the build faster and makes it easier to identify which code gets built in.   * Look at the directories and built-in.o files that show up in a tinyconfig build, and check for directories where all of the code depends (directly or indirectly) on a single configuration symbol. ​ (''​find -name built-in.o -size 8c''​ will find built-in.o files that contain no code.) in the Makefile for the parent directory, change obj-y to obj-$(CONFIG_THAT_SYMBOL),​ to stop the build system from recursing into that directory at all.  This doesn'​t directly make the kernel smaller, but makes the build faster and makes it easier to identify which code gets built in.
-  * Compile out kernel/​time/​ntp.c,​ along with adjtimex and similar syscalls. (in progress)+  * Compile out kernel/​time/​ntp.c,​ along with adjtimex and similar syscalls. (done)
   * Remove runtime extable sorting logic if CONFIG_BUILDTIME_EXTABLE_SORT (in progress)   * Remove runtime extable sorting logic if CONFIG_BUILDTIME_EXTABLE_SORT (in progress)
   * Sort module extables at build time, as CONFIG_BUILDTIME_EXTABLE_SORT does for vmlinux, and drop the runtime sort.   * Sort module extables at build time, as CONFIG_BUILDTIME_EXTABLE_SORT does for vmlinux, and drop the runtime sort.
-  ​* Rip out the rest of kernel/​smpboot.c if !CONFIG_SMP +  * Compile out printks below a certain priority level. ​(in progress) 
-  * Make SRCU optional; make portions of the kernel that define an ''​srcu_struct''​ depend on the resulting new Kconfig symbol. +  * Compile out x86 CPU information printing and corresponding structure fields: model decoding, TLB size decoding. ​ Add a config option for this, and make it depend on CONFIG_PRINTK ​or in some cases CONFIG_PROC_FS (for /​proc/​cpuinfo)(in progress) 
-  ​* Compile out printks below a certain priority level. +  * Reverse CONFIG_DISABLE_DEV_COREDUMP to have "​default y" and use '​n'​ to force-disable,​ so allnoconfig and tinyconfig do the right thing. (done
-  * Compile out x86 CPU information printing and corresponding structure fields: model decoding, TLB size decoding. ​ Add a config option for this, and make it depend on CONFIG_PRINTK. +  * Drop legacy processor names from struct cpu_dev. ​ May need to make this a configuration option. (done) 
-  * Reverse CONFIG_DISABLE_DEV_COREDUMP to have "​default y" and use '​n'​ to force-disable,​ so allnoconfig and tinyconfig do the right thing. (in progress+  * Make mm/debug.c optional. (in progress) 
-  * Drop legacy processor names from struct cpu_dev. ​ May need to make this a configuration option. (in progress)+  * Make lib/​halfmd4.c optional, and make ext3 and ext4 select it. (done) 
 +  * Make lib/​rhashtable.c optional, and make the relevant bits of net/ select it. (done) 
 +  * Make flex_array optional, and make the three things using it (selinux, openvswitch,​ PROC_FS) select it. (done) 
 +  * Enhance scripts/​bloat-o-meter to detect size changes in sections like .rodata not associated with a symbol. ​ In particular, this should detect changes to string constants.
  
 ====== Larger projects ====== ====== Larger projects ======
  
-  * Add size test for kselftest: boot a minimal ​kernel ​under qemu/kvm, and capture information from that kernel.  ​CONFIG_PRINTK would allow capturing ​the display of available memory from early bootbut we want to support kernels without CONFIG_PRINTK. ​ This could also use -mem-path ​and capture data directly from a memory address.  ​Ideally, the memory check and writing to a specified address should occur right before ​the kernel ​would attempt to run /sbin/init; the check itself needs to be optional too, though.+  * Make SRCU optional; make portions of the kernel that define an ''​srcu_struct''​ depend on the resulting new Kconfig symbol.  ​This will include ​the srcu_notifier mechanismin turn used by the clock framework ​and cpufreq. 
 +  * Rip out the rest of kernel/smpboot.c if !CONFIG_SMP
   * Make ptrace optional.   * Make ptrace optional.
   * Rip out more of the per-CPU infrastructure when ''​CONFIG_SMP=n''​   * Rip out more of the per-CPU infrastructure when ''​CONFIG_SMP=n''​
Line 22: Line 28:
   * Compile out ''​mm/​vmstat''​ (need to stub out bits that obtain statistics used by other bits of the kernel)   * Compile out ''​mm/​vmstat''​ (need to stub out bits that obtain statistics used by other bits of the kernel)
   * Compile out signal handling.   * Compile out signal handling.
-  * Compile out support for capabilities;​ make capable always return true for root and false for non-root.+  * Compile out support for capabilities;​ make capable always return true for root and false for non-root. ​(done)
   * Compile out support for "​personalities"​.   * Compile out support for "​personalities"​.
-  * Compile out support for non-root users and groups. ​ When disabled, UID and GID effectively always equal 0, and all the syscalls involving UIDs and GIDs go away.+  * Compile out support for non-root users and groups. ​ When disabled, UID and GID effectively always equal 0, and all the syscalls involving UIDs and GIDs go away. (done)
   * Compile out support for supplementary GIDs.  (This option would depend on the previous option for non-root users and groups.)   * Compile out support for supplementary GIDs.  (This option would depend on the previous option for non-root users and groups.)
   * Compile out support for xattrs, and all the corresponding syscalls.   * Compile out support for xattrs, and all the corresponding syscalls.
   * Compile out support for sockets and all the socket-related syscalls.   * Compile out support for sockets and all the socket-related syscalls.
 +  * Compile out support for character devices, similar to the existing CONFIG_BLOCK.
   * Support nommu on x86.   * Support nommu on x86.
   * Revive the function-sections support. ​ (Note: LTO would make this obsolete; only worth working on this if LTO takes too long to get upstream.)   * Revive the function-sections support. ​ (Note: LTO would make this obsolete; only worth working on this if LTO takes too long to get upstream.)
Line 35: Line 42:
   * Execute in place (XIP) for x86   * Execute in place (XIP) for x86
   * Constant folding for unused mount options (for instance, drop ext4's dioread_lock options at build time)   * Constant folding for unused mount options (for instance, drop ext4's dioread_lock options at build time)
 +  * Add size test for kselftest: boot a minimal kernel under qemu/kvm, and capture information from that kernel. ​ CONFIG_PRINTK would allow capturing the display of available memory from early boot, but we want to support kernels without CONFIG_PRINTK. ​ This could also use -mem-path and capture data directly from a memory address. ​ Ideally, the memory check and writing to a specified address should occur right before the kernel would attempt to run /sbin/init; the check itself needs to be optional too, though.
   * Go look at patches in OpenWRT to make the kernel smaller   * Go look at patches in OpenWRT to make the kernel smaller
   * Analyze size of inlines (Andi Kleen has some scripts)   * Analyze size of inlines (Andi Kleen has some scripts)
Line 48: Line 56:
     * make most of sys.o configurable     * make most of sys.o configurable
     * make notifier.o configurable     * make notifier.o configurable
 +  * Allow board-specific DT parser removal. ​ From Josh, "... effectively compile in a parsed description and ditch the parser. Bonus if you can make the values parsed out of it into compile-time constants for constant folding."​ Jason Cooper <​jason@lakedaemon.net>​ is responsible for this idea.
  
 ====== Projects requiring toolchain changes ====== ====== Projects requiring toolchain changes ======
Line 58: Line 67:
   * Automatic structure re-layout to drop fields not referenced   * Automatic structure re-layout to drop fields not referenced
   * Dropping structure field assignments;​ mark dead fields with an attribute, ignore writes, error on reads   * Dropping structure field assignments;​ mark dead fields with an attribute, ignore writes, error on reads
 +  * Compile out support for specific format-string components from snprintf and family; would require some support from the toolchain to detect which ones get used in a build. Alternatively,​ replace all the non-human-targeted uses of snprintf with a call to an underlying helper function shared with snprintf, and then use dead code elimination to drop the unused ones.
projects.1413777831.txt.gz · Last modified: 2014-10-20 04:03 by joshtriplett