From 93550778d80441928642240828009b9ec0813792 Mon Sep 17 00:00:00 2001 From: huangzq2 Date: Wed, 14 Nov 2018 17:35:24 +0800 Subject: [PATCH] tune the kernel and system Change-Id: Iae23743c8806a3bccfe90832f5bf431ec9a66865 Signed-off-by: huangzq2 Reviewed-on: https://gerrit.mot.com/1268942 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Xiangpo Zhao Submit-Approved: Jira Key --- .../ext_config/debug-erd9610-kane.config | 6 +- .../configs/ext_config/debug-erd9610.config | 55 +++++++++++++++++++ .../configs/ext_config/factory-erd9610.config | 20 +++++++ .../ext_config/moto-erd9610-kane.config | 18 +++++- .../configs/ext_config/moto-erd9610.config | 39 +++++++++++++ defconfig.mk | 4 +- lib/Kconfig.debug | 11 ++++ mm/page_owner.c | 6 +- 8 files changed, 153 insertions(+), 6 deletions(-) create mode 100644 arch/arm64/configs/ext_config/debug-erd9610.config create mode 100644 arch/arm64/configs/ext_config/factory-erd9610.config create mode 100644 arch/arm64/configs/ext_config/moto-erd9610.config diff --git a/arch/arm64/configs/ext_config/debug-erd9610-kane.config b/arch/arm64/configs/ext_config/debug-erd9610-kane.config index afd7daff21f4..cd563e99ba70 100644 --- a/arch/arm64/configs/ext_config/debug-erd9610-kane.config +++ b/arch/arm64/configs/ext_config/debug-erd9610-kane.config @@ -1,14 +1,14 @@ # # Please avoid changing the Samsung defconfig files and use this file to # add any Motorola-specific configuration changes that are applicable to -# userdebug and eng builds. +# userdebug, eng, and user builds. # # After building, a list of all of the config files that are used can be found # at the top of: -# out/target/product/$(PRODUCT)/obj/kernel/exynos/mapphone_defconfig +# out/target/product/$(PRODUCT)/obj/KERNEL_OBJ/mapphone_defconfig # # The actual output of the kernel configuration system can be found at: -# kernel/exynos/.config +# out/target/product/$(PRODUCT)/obj/KERNEL_OBJ/.config # # You can check the .config file to verify that your configuration option is # being set as expected. diff --git a/arch/arm64/configs/ext_config/debug-erd9610.config b/arch/arm64/configs/ext_config/debug-erd9610.config new file mode 100644 index 000000000000..4c395d7d73df --- /dev/null +++ b/arch/arm64/configs/ext_config/debug-erd9610.config @@ -0,0 +1,55 @@ +# +# Please avoid changing the Samsung defconfig files and use this file to +# add any Motorola-specific configuration changes that are applicable to +# userdebug, eng, and user builds. +# +# After building, a list of all of the config files that are used can be found +# at the top of: +# out/target/product/$(PRODUCT)/obj/KERNEL_OBJ/mapphone_defconfig +# +# The actual output of the kernel configuration system can be found at: +# out/target/product/$(PRODUCT)/obj/KERNEL_OBJ/.config +# +# You can check the .config file to verify that your configuration option is +# being set as expected. +# + +CONFIG_LOG_BUF_SHIFT=21 +CONFIG_SLUB_DEBUG=y +# CONFIG_SLUB_DEBUG_ON is not set +# CONFIG_SLUB_DEBUG_PANIC_ON is not set +CONFIG_DEBUG_KMEMLEAK=y +CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE=4000 +CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF=y +CONFIG_PAGE_OWNER=y +CONFIG_PAGE_OWNER_ENABLE_DEFAULT=y +CONFIG_DEBUG_PAGEALLOC=y +CONFIG_DEBUG_PAGEALLOC_ENABLE_DEFAULT=y +CONFIG_DEBUG_OBJECTS=y +CONFIG_DEBUG_OBJECTS_FREE=y +CONFIG_DEBUG_OBJECTS_TIMERS=y +CONFIG_DEBUG_OBJECTS_WORK=y +CONFIG_DEBUG_OBJECTS_RCU_HEAD=y +CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER=y +CONFIG_TASK_DELAY_ACCT=y +CONFIG_CGROUP_DEBUG=y +CONFIG_CLEANCACHE=y +CONFIG_CMA_DEBUGFS=y +CONFIG_PM_DEBUG=y +CONFIG_DEBUG_MEMORY_INIT=y +CONFIG_LOCKUP_DETECTOR=y +CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=y +CONFIG_WQ_WATCHDOG=y +CONFIG_PANIC_ON_SCHED_BUG=y +CONFIG_PANIC_ON_RT_THROTTLING=y +CONFIG_PANIC_ON_DATA_CORRUPTION=y +CONFIG_SCHED_STACK_END_CHECK=y +CONFIG_DEBUG_SPINLOCK=y +CONFIG_DEBUG_MUTEXES=y +CONFIG_DEBUG_ATOMIC_SLEEP=y +CONFIG_DEBUG_LIST=y +CONFIG_FAULT_INJECTION=y +CONFIG_FAIL_PAGE_ALLOC=y +CONFIG_FAULT_INJECTION_DEBUG_FS=y +CONFIG_FAULT_INJECTION_STACKTRACE_FILTER=y + diff --git a/arch/arm64/configs/ext_config/factory-erd9610.config b/arch/arm64/configs/ext_config/factory-erd9610.config new file mode 100644 index 000000000000..61ff36edacbe --- /dev/null +++ b/arch/arm64/configs/ext_config/factory-erd9610.config @@ -0,0 +1,20 @@ +# +# Please avoid changing the Samsung defconfig files and use this file to +# add any Motorola-specific configuration changes that are applicable to +# userdebug, eng, and user builds. +# +# After building, a list of all of the config files that are used can be found +# at the top of: +# out/target/product/$(PRODUCT)/obj/KERNEL_OBJ/mapphone_defconfig +# +# The actual output of the kernel configuration system can be found at: +# out/target/product/$(PRODUCT)/obj/KERNEL_OBJ/.config +# +# You can check the .config file to verify that your configuration option is +# being set as expected. +# + + + + + diff --git a/arch/arm64/configs/ext_config/moto-erd9610-kane.config b/arch/arm64/configs/ext_config/moto-erd9610-kane.config index 796c6a869661..b31e04d4d937 100644 --- a/arch/arm64/configs/ext_config/moto-erd9610-kane.config +++ b/arch/arm64/configs/ext_config/moto-erd9610-kane.config @@ -1,4 +1,19 @@ -#MOTO +# +# Please avoid changing the Samsung defconfig files and use this file to +# add any Motorola-specific configuration changes that are applicable to +# userdebug, eng, and user builds. +# +# After building, a list of all of the config files that are used can be found +# at the top of: +# out/target/product/$(PRODUCT)/obj/KERNEL_OBJ/mapphone_defconfig +# +# The actual output of the kernel configuration system can be found at: +# out/target/product/$(PRODUCT)/obj/KERNEL_OBJ/.config +# +# You can check the .config file to verify that your configuration option is +# being set as expected. +# + CONFIG_USB_ANDROID_USBNET=y CONFIG_BOOTINFO=y CONFIG_PSTORE_RAM_ANNOTATION_APPEND=y @@ -12,3 +27,4 @@ CONFIG_HWMON=y CONFIG_SENSORS_NTC_THERMISTOR=y CONFIG_SND_SOC_AOV_TRIGGER=y CONFIG_DROPBOX=y + diff --git a/arch/arm64/configs/ext_config/moto-erd9610.config b/arch/arm64/configs/ext_config/moto-erd9610.config new file mode 100644 index 000000000000..ea2e53f145e8 --- /dev/null +++ b/arch/arm64/configs/ext_config/moto-erd9610.config @@ -0,0 +1,39 @@ +# +# Please avoid changing the Samsung defconfig files and use this file to +# add any Motorola-specific configuration changes that are applicable to +# userdebug, eng, and user builds. +# +# After building, a list of all of the config files that are used can be found +# at the top of: +# out/target/product/$(PRODUCT)/obj/KERNEL_OBJ/mapphone_defconfig +# +# The actual output of the kernel configuration system can be found at: +# out/target/product/$(PRODUCT)/obj/KERNEL_OBJ/.config +# +# You can check the .config file to verify that your configuration option is +# being set as expected. +# + +CONFIG_HZ_300=y +CONFIG_SWAP=y +CONFIG_ZSMALLOC=y +CONFIG_ZRAM=y +CONFIG_CRYPTO_LZ4=y +CONFIG_CRYPTO_GCM=y +CONFIG_IPV6_VTI=y +CONFIG_NET_IPVTI=y +CONFIG_ECRYPT_FS=y +CONFIG_F2FS_FS_ENCRYPTION=y +CONFIG_SUSPEND_SKIP_SYNC=y +# CONFIG_SCHED_DEBUG is not set +# CONFIG_KSM is not set +# CONFIG_SLUB_DEBUG is not set +# CONFIG_DEBUG_KMEMLEAK is not set +# CONFIG_PAGE_OWNER is not set +# CONFIG_DEBUG_PAGEALLOC is not set +# CONFIG_DEBUG_OBJECTS is not set +# CONFIG_FAULT_INJECTION is not set + + + + diff --git a/defconfig.mk b/defconfig.mk index ac49136fe3e9..a42c49ee030a 100644 --- a/defconfig.mk +++ b/defconfig.mk @@ -1,6 +1,8 @@ DEFCONFIGSRC := $(TARGET_KERNEL_SOURCE)/arch/$(KERNEL_ARCH)/configs LJAPDEFCONFIGSRC := ${DEFCONFIGSRC}/ext_config +ifeq ($(DEFCONFIG_BASENAME),) DEFCONFIG_BASENAME := $(subst -perf,,$(subst _defconfig,,$(KERNEL_DEFCONFIG))) +endif PRODUCT_SPECIFIC_DEFCONFIGS := $(DEFCONFIGSRC)/$(KERNEL_DEFCONFIG) $(LJAPDEFCONFIGSRC)/moto-$(DEFCONFIG_BASENAME).config TARGET_DEFCONFIG := $(KERNEL_OUT)/mapphone_defconfig KERNEL_DEBUG_DEFCONFIG := $(LJAPDEFCONFIGSRC)/debug-$(DEFCONFIG_BASENAME).config @@ -8,7 +10,6 @@ PRODUCT_KERNEL_DEBUG_DEFCONFIG := $(LJAPDEFCONFIGSRC)/$(PRODUCT_DEBUG_DEFCONFIG FACTORY_DEFCONFIG := $(LJAPDEFCONFIGSRC)/factory-$(DEFCONFIG_BASENAME).config -PRODUCT_SPECIFIC_DEFCONFIGS := $(DEFCONFIGSRC)/$(KERNEL_DEFCONFIG) # append all additional configs ifneq ($(KERNEL_EXTRA_CONFIG),) PRODUCT_SPECIFIC_DEFCONFIGS += $(KERNEL_EXTRA_CONFIG:%=$(LJAPDEFCONFIGSRC)/%.config) @@ -36,6 +37,7 @@ define do-make-defconfig ( perl -le 'print "# This file was automatically generated from:\n#\t" . join("\n#\t", @ARGV) . "\n"' $(2) && cat $(2) ) > $(1) || ( rm -f $(1) && false ) endef + # # make combined defconfig file #--------------------------------------- diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 090beb7f5f5a..3a37abf20f74 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -292,6 +292,17 @@ config PAGE_OWNER If unsure, say N. +config PAGE_OWNER_ENABLE_DEFAULT + bool "Enable Track page owner by default" + depends on PAGE_OWNER + ---help--- + This keeps track of what call chain is the owner of a page, may + help to find bare alloc_page(s) leaks. If you include this + feature on your build, it is enabled by default. You should pass + "page_owner=off" to boot parameter in order to disable it. Eats + a fair amount of memory if enabled. See tools/vm/page_owner_sort.c + for user-space helper. + config DEBUG_FS bool "Debug Filesystem" help diff --git a/mm/page_owner.c b/mm/page_owner.c index 4753b317ef7b..cecd9f636b42 100644 --- a/mm/page_owner.c +++ b/mm/page_owner.c @@ -26,7 +26,8 @@ struct page_owner { depot_stack_handle_t handle; }; -static bool page_owner_disabled = true; +static bool page_owner_disabled = + !IS_ENABLED(CONFIG_PAGE_OWNER_ENABLE_DEFAULT); DEFINE_STATIC_KEY_FALSE(page_owner_inited); static depot_stack_handle_t dummy_handle; @@ -43,6 +44,9 @@ static int early_page_owner_param(char *buf) if (strcmp(buf, "on") == 0) page_owner_disabled = false; + if (strcmp(buf, "off") == 0) + page_owner_disabled = true; + return 0; } early_param("page_owner", early_page_owner_param); -- 2.20.1