Commit d68b4b6f authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'mm-nonmm-stable-2023-08-28-22-48' of...

Merge tag 'mm-nonmm-stable-2023-08-28-22-48' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull non-MM updates from Andrew Morton:

 - An extensive rework of kexec and crash Kconfig from Eric DeVolder
   ("refactor Kconfig to consolidate KEXEC and CRASH options")

 - kernel.h slimming work from Andy Shevchenko ("kernel.h: Split out a
   couple of macros to args.h")

 - gdb feature work from Kuan-Ying Lee ("Add GDB memory helper
   commands")

 - vsprintf inclusion rationalization from Andy Shevchenko
   ("lib/vsprintf: Rework header inclusions")

 - Switch the handling of kdump from a udev scheme to in-kernel
   handling, by Eric DeVolder ("crash: Kernel handling of CPU and memory
   hot un/plug")

 - Many singleton patches to various parts of the tree

* tag 'mm-nonmm-stable-2023-08-28-22-48' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (81 commits)
  document while_each_thread(), change first_tid() to use for_each_thread()
  drivers/char/mem.c: shrink character device's devlist[] array
  x86/crash: optimize CPU changes
  crash: change crash_prepare_elf64_headers() to for_each_possible_cpu()
  crash: hotplug support for kexec_load()
  x86/crash: add x86 crash hotplug support
  crash: memory and CPU hotplug sysfs attributes
  kexec: exclude elfcorehdr from the segment digest
  crash: add generic infrastructure for crash hotplug support
  crash: move a few code bits to setup support of crash hotplug
  kstrtox: consistently use _tolower()
  kill do_each_thread()
  nilfs2: fix WARNING in mark_buffer_dirty due to discarded buffer reuse
  scripts/bloat-o-meter: count weak symbol sizes
  treewide: drop CONFIG_EMBEDDED
  lockdep: fix static memory detection even more
  lib/vsprintf: declare no_hash_pointers in sprintf.h
  lib/vsprintf: split out sprintf() and friends
  kernel/fork: stop playing lockless games for exe_file replacement
  adfs: delete unused "union adfs_dirtail" definition
  ...
parents b96a3e91 dce8f8ed
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -110,3 +110,11 @@ Description:
		link is created for memory section 9 on node0.

		/sys/devices/system/node/node0/memory9 -> ../../memory/memory9

What:		/sys/devices/system/memory/crash_hotplug
Date:		Aug 2023
Contact:	Linux kernel mailing list <linux-kernel@vger.kernel.org>
Description:
		(RO) indicates whether or not the kernel directly supports
		modifying the crash elfcorehdr for memory hot un/plug and/or
		on/offline changes.
+8 −0
Original line number Diff line number Diff line
@@ -688,3 +688,11 @@ Description:
		(RO) the list of CPUs that are isolated and don't
		participate in load balancing. These CPUs are set by
		boot parameter "isolcpus=".

What:		/sys/devices/system/cpu/crash_hotplug
Date:		Aug 2023
Contact:	Linux kernel mailing list <linux-kernel@vger.kernel.org>
Description:
		(RO) indicates whether or not the kernel directly supports
		modifying the crash elfcorehdr for CPU hot un/plug and/or
		on/offline changes.
+8 −0
Original line number Diff line number Diff line
@@ -291,6 +291,14 @@ The following files are currently defined:
		       Availability depends on the CONFIG_ARCH_MEMORY_PROBE
		       kernel configuration option.
``uevent``	       read-write: generic udev file for device subsystems.
``crash_hotplug``      read-only: when changes to the system memory map
		       occur due to hot un/plug of memory, this file contains
		       '1' if the kernel updates the kdump capture kernel memory
		       map itself (via elfcorehdr), or '0' if userspace must update
		       the kdump capture kernel memory map.

		       Availability depends on the CONFIG_MEMORY_HOTPLUG kernel
		       configuration option.
====================== =========================================================

.. note::
+18 −0
Original line number Diff line number Diff line
@@ -741,6 +741,24 @@ will receive all events. A script like::

can process the event further.

When changes to the CPUs in the system occur, the sysfs file
/sys/devices/system/cpu/crash_hotplug contains '1' if the kernel
updates the kdump capture kernel list of CPUs itself (via elfcorehdr),
or '0' if userspace must update the kdump capture kernel list of CPUs.

The availability depends on the CONFIG_HOTPLUG_CPU kernel configuration
option.

To skip userspace processing of CPU hot un/plug events for kdump
(i.e. the unload-then-reload to obtain a current list of CPUs), this sysfs
file can be used in a udev rule as follows:

 SUBSYSTEM=="cpu", ATTRS{crash_hotplug}=="1", GOTO="kdump_reload_end"

For a CPU hot un/plug event, if the architecture supports kernel updates
of the elfcorehdr (which contains the list of CPUs), then the rule skips
the unload-then-reload of the kdump capture kernel.

Kernel Inline Documentations Reference
======================================

+3 −14
Original line number Diff line number Diff line
@@ -11,19 +11,6 @@ source "arch/$(SRCARCH)/Kconfig"

menu "General architecture-dependent options"

config CRASH_CORE
	bool

config KEXEC_CORE
	select CRASH_CORE
	bool

config KEXEC_ELF
	bool

config HAVE_IMA_KEXEC
	bool

config ARCH_HAS_SUBPAGE_FAULTS
	bool
	help
@@ -748,7 +735,9 @@ config HAS_LTO_CLANG
	depends on $(success,$(AR) --help | head -n 1 | grep -qi llvm)
	depends on ARCH_SUPPORTS_LTO_CLANG
	depends on !FTRACE_MCOUNT_USE_RECORDMCOUNT
	depends on !KASAN || KASAN_HW_TAGS
	# https://github.com/ClangBuiltLinux/linux/issues/1721
	depends on (!KASAN || KASAN_HW_TAGS || CLANG_VERSION >= 170000) || !DEBUG_INFO
	depends on (!KCOV || CLANG_VERSION >= 170000) || !DEBUG_INFO
	depends on !GCOV_KERNEL
	help
	  The compiler and Kconfig options support building with Clang's
Loading