From 3aaefce10351fecab348f5e06857f44cafc61a62 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Wed, 6 Aug 2014 15:21:00 -0700 Subject: x86, platform, kconfig: move kvmconfig functionality to a helper The new mergeconfig helper makes it easier to add other partial configurations similar to kvmconfig. Architecture-independent portions of those partial configurations should go in kernel/configs/${name}.config, and architecture-dependent portions should go in arch/${arch}/configs/${name}.config. Based on a patch by Luis R. Rodriguez . Originally-Signed-off-by: Luis R. Rodriguez Modified to make the helper name more general than just virtualization, support architecture-dependent and architecture-independent partial configurations, move the helper and kvmconfig to scripts/kconfig/Makefile, and factor out more of the common file path. Signed-off-by: Josh Triplett --- scripts/kconfig/Makefile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'scripts') diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 9c4d2412fb72..8083b94b45ee 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -104,6 +104,19 @@ endif %_defconfig: $(obj)/conf $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig) +configfiles=$(wildcard $(srctree)/kernel/configs/$(1).config $(srctree)/arch/$(SRCARCH)/configs/$(1).config) + +define mergeconfig +$(if $(wildcard $(objtree)/.config),, $(error You need an existing .config for this target)) +$(if $(call configfiles,$(1)),, $(error No configuration exists for this target on this architecture)) +$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(call configfiles,$(1)) +$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig +endef + +PHONY += kvmconfig +kvmconfig: + $(call mergeconfig,kvm_guest) + # Help text used by make help help: @echo ' config - Update current config utilising a line-oriented program' @@ -124,6 +137,7 @@ help: @echo ' randconfig - New config with random answer to all options' @echo ' listnewconfig - List new options' @echo ' olddefconfig - Same as silentoldconfig but sets new symbols to their default value' + @echo ' kvmconfig - Enable additional options for guest kernel support' # lxdialog stuff check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh -- cgit v1.2.3 From 0da1d4a0b9516adb2acc4841e9f6da6618f47f4e Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Fri, 8 Aug 2014 16:25:47 -0700 Subject: x86: Add "make tinyconfig" to configure the tiniest possible kernel Since commit 5d2acfc7b974bbd3858b4dd3f2cdc6362dd8843a ("kconfig: make allnoconfig disable options behind EMBEDDED and EXPERT") in 3.15-rc1, "make allnoconfig" disables every possible config option. However, a few configuration options (CC_OPTIMIZE_FOR_SIZE, OPTIMIZE_INLINING) produce a smaller kernel when turned on, and a few choices exist (compression, highmem, allocator) for which a non-default option produces a smaller kernel. Add a "tinyconfig" option, which starts from allnoconfig and then sets these options to configure the tiniest possible kernel. This provides a better baseline for embedded systems or efforts to reduce kernel size. Signed-off-by: Josh Triplett --- arch/x86/configs/tiny.config | 1 + kernel/configs/tiny.config | 4 ++++ scripts/kconfig/Makefile | 5 +++++ 3 files changed, 10 insertions(+) create mode 100644 arch/x86/configs/tiny.config create mode 100644 kernel/configs/tiny.config (limited to 'scripts') diff --git a/arch/x86/configs/tiny.config b/arch/x86/configs/tiny.config new file mode 100644 index 000000000000..4e2ecfa23c15 --- /dev/null +++ b/arch/x86/configs/tiny.config @@ -0,0 +1 @@ +CONFIG_NOHIGHMEM=y diff --git a/kernel/configs/tiny.config b/kernel/configs/tiny.config new file mode 100644 index 000000000000..c2de56ab0fce --- /dev/null +++ b/kernel/configs/tiny.config @@ -0,0 +1,4 @@ +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_KERNEL_XZ=y +CONFIG_OPTIMIZE_INLINING=y +CONFIG_SLOB=y diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 8083b94b45ee..ebf40f6edb4d 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -117,6 +117,10 @@ PHONY += kvmconfig kvmconfig: $(call mergeconfig,kvm_guest) +PHONY += tinyconfig +tinyconfig: allnoconfig + $(call mergeconfig,tiny) + # Help text used by make help help: @echo ' config - Update current config utilising a line-oriented program' @@ -138,6 +142,7 @@ help: @echo ' listnewconfig - List new options' @echo ' olddefconfig - Same as silentoldconfig but sets new symbols to their default value' @echo ' kvmconfig - Enable additional options for guest kernel support' + @echo ' tinyconfig - Configure the tiniest possible kernel' # lxdialog stuff check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh -- cgit v1.2.3 From b25c2ff547530f63d71fc67048543ae54b434476 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sun, 17 Aug 2014 19:45:46 -0500 Subject: bloat-o-meter: Ignore syscall aliases SyS_ and compat_SyS_ This avoids double-counting size changes in syscall implementations. Signed-off-by: Josh Triplett --- scripts/bloat-o-meter | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/bloat-o-meter b/scripts/bloat-o-meter index 549d0ab8c662..23e78dcd12bf 100755 --- a/scripts/bloat-o-meter +++ b/scripts/bloat-o-meter @@ -20,6 +20,8 @@ def getsizes(file): if type in "tTdDbBrR": # strip generated symbols if name.startswith("__mod_"): continue + if name.startswith("SyS_"): continue + if name.startswith("compat_SyS_"): continue if name == "linux_banner": continue # statics and some other optimizations adds random .NUMBER name = re.sub(r'\.[0-9]+', '', name) -- cgit v1.2.3