The patch titled Subject: vmcore: Add a kernel parameter novmcoredd has been added to the -mm tree. Its filename is vmcore-add-a-kernel-parameter-novmcoredd.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/vmcore-add-a-kernel-parameter-novmcoredd.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/vmcore-add-a-kernel-parameter-novmcoredd.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Kairui Song <kasong@xxxxxxxxxx> Subject: vmcore: Add a kernel parameter novmcoredd Since commit 2724273e8fd0 ("vmcore: add API to collect hardware dump in second kernel"), drivers is allowed to add device related dump data to vmcore as they want by using the device dump API. This have a potential issue, the data is stored in memory, drivers may append too much data and use too much memory. The vmcore is typically used in a kdump kernel which runs in a pre-reserved small chunk of memory. So as a result it will make kdump unusable at all due to OOM issues. So introduce new 'novmcoredd' command line option. User can disable device dump to reduce memory usage. This is helpful if device dump is using too much memory, disabling device dump could make sure a regular vmcore without device dump data is still available. Link: http://lkml.kernel.org/r/20190528111856.7276-1-kasong@xxxxxxxxxx Signed-off-by: Kairui Song <kasong@xxxxxxxxxx> Acked-by: Dave Young <dyoung@xxxxxxxxxx> Cc: Rahul Lakkireddy <rahul.lakkireddy@xxxxxxxxxxx> Cc: "David S . Miller" <davem@xxxxxxxxxxxxx> Cc: Eric Biederman <ebiederm@xxxxxxxxxxxx> Cc: Alexey Dobriyan <adobriyan@xxxxxxxxx> Cc: Bhupesh Sharma <bhsharma@xxxxxxxxxx> Cc: Baoquan He <bhe@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- Documentation/admin-guide/kernel-parameters.txt | 11 +++++++++++ fs/proc/Kconfig | 3 ++- fs/proc/vmcore.c | 8 ++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) --- a/Documentation/admin-guide/kernel-parameters.txt~vmcore-add-a-kernel-parameter-novmcoredd +++ a/Documentation/admin-guide/kernel-parameters.txt @@ -2872,6 +2872,17 @@ /sys/module/printk/parameters/console_suspend) to turn on/off it dynamically. + novmcoredd [KNL,KDUMP] + Disable device dump. Device dump allows drivers to + append dump data to vmcore so you can collect driver + specified debug info. The drivers could append the + data without any limit, and the data is stored in + memory, this may bring a significant memory stress. + Disable device dump can help save memory but driver + debug data will be no longer available. + Only available when CONFIG_PROC_VMCORE_DEVICE_DUMP + is set. + noaliencache [MM, NUMA, SLAB] Disables the allocation of alien caches in the slab allocator. Saves per-node memory, but will impact performance. --- a/fs/proc/Kconfig~vmcore-add-a-kernel-parameter-novmcoredd +++ a/fs/proc/Kconfig @@ -58,7 +58,8 @@ config PROC_VMCORE_DEVICE_DUMP snapshot. If you say Y here, the collected device dumps will be added - as ELF notes to /proc/vmcore. + as ELF notes to /proc/vmcore. You can still disabled device + dump by command line option 'novmcoredd'. config PROC_SYSCTL bool "Sysctl support (/proc/sys)" if EXPERT --- a/fs/proc/vmcore.c~vmcore-add-a-kernel-parameter-novmcoredd +++ a/fs/proc/vmcore.c @@ -54,6 +54,9 @@ static struct proc_dir_entry *proc_vmcor /* Device Dump list and mutex to synchronize access to list */ static LIST_HEAD(vmcoredd_list); static DEFINE_MUTEX(vmcoredd_mutex); + +static bool vmcoredd_disabled; +core_param(novmcoredd, vmcoredd_disabled, bool, 0); #endif /* CONFIG_PROC_VMCORE_DEVICE_DUMP */ /* Device Dump Size */ @@ -1452,6 +1455,11 @@ int vmcore_add_device_dump(struct vmcore size_t data_size; int ret; + if (vmcoredd_disabled) { + pr_err_once("Device dump is disabled\n"); + return -EINVAL; + } + if (!data || !strlen(data->dump_name) || !data->vmcoredd_callback || !data->size) return -EINVAL; _ Patches currently in -mm which might be from kasong@xxxxxxxxxx are vmcore-add-a-kernel-parameter-novmcoredd.patch