Commit 71bd9341 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'akpm' (patches from Andrew)

Merge more updates from Andrew Morton:
 "190 patches.

  Subsystems affected by this patch series: mm (hugetlb, userfaultfd,
  vmscan, kconfig, proc, z3fold, zbud, ras, mempolicy, memblock,
  migration, thp, nommu, kconfig, madvise, memory-hotplug, zswap,
  zsmalloc, zram, cleanups, kfence, and hmm), procfs, sysctl, misc,
  core-kernel, lib, lz4, checkpatch, init, kprobes, nilfs2, hfs,
  signals, exec, kcov, selftests, compress/decompress, and ipc"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (190 commits)
  ipc/util.c: use binary search for max_idx
  ipc/sem.c: use READ_ONCE()/WRITE_ONCE() for use_global_lock
  ipc: use kmalloc for msg_queue and shmid_kernel
  ipc sem: use kvmalloc for sem_undo allocation
  lib/decompressors: remove set but not used variabled 'level'
  selftests/vm/pkeys: exercise x86 XSAVE init state
  selftests/vm/pkeys: refill shadow register after implicit kernel write
  selftests/vm/pkeys: handle negative sys_pkey_alloc() return code
  selftests/vm/pkeys: fix alloc_random_pkey() to make it really, really random
  kcov: add __no_sanitize_coverage to fix noinstr for all architectures
  exec: remove checks in __register_bimfmt()
  x86: signal: don't do sas_ss_reset() until we are certain that sigframe won't be abandoned
  hfsplus: report create_date to kstat.btime
  hfsplus: remove unnecessary oom message
  nilfs2: remove redundant continue statement in a while-loop
  kprobes: remove duplicated strong free_insn_page in x86 and s390
  init: print out unknown kernel parameters
  checkpatch: do not complain about positive return values starting with EPOLL
  checkpatch: improve the indented label test
  checkpatch: scripts/spdxcheck.py now requires python3
  ...
parents 3dbdb38e b869d5be
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -1594,6 +1594,23 @@
			Documentation/admin-guide/mm/hugetlbpage.rst.
			Format: size[KMG]

	hugetlb_free_vmemmap=
			[KNL] Reguires CONFIG_HUGETLB_PAGE_FREE_VMEMMAP
			enabled.
			Allows heavy hugetlb users to free up some more
			memory (6 * PAGE_SIZE for each 2MB hugetlb page).
			Format: { on | off (default) }

			on:  enable the feature
			off: disable the feature

			Built with CONFIG_HUGETLB_PAGE_FREE_VMEMMAP_DEFAULT_ON=y,
			the default is on.

			This is not compatible with memory_hotplug.memmap_on_memory.
			If both parameters are enabled, hugetlb_free_vmemmap takes
			precedence over memory_hotplug.memmap_on_memory.

	hung_task_panic=
			[KNL] Should the hung task detector generate panics.
			Format: 0 | 1
@@ -2860,6 +2877,10 @@
			Note that even when enabled, there are a few cases where
			the feature is not effective.

			This is not compatible with hugetlb_free_vmemmap. If
			both parameters are enabled, hugetlb_free_vmemmap takes
			precedence over memory_hotplug.memmap_on_memory.

	memtest=	[KNL,X86,ARM,PPC,RISCV] Enable memtest
			Format: <integer>
			default : 0 <disable>
+11 −0
Original line number Diff line number Diff line
@@ -60,6 +60,10 @@ HugePages_Surp
        the pool above the value in ``/proc/sys/vm/nr_hugepages``. The
        maximum number of surplus huge pages is controlled by
        ``/proc/sys/vm/nr_overcommit_hugepages``.
	Note: When the feature of freeing unused vmemmap pages associated
	with each hugetlb page is enabled, the number of surplus huge pages
	may be temporarily larger than the maximum number of surplus huge
	pages when the system is under memory pressure.
Hugepagesize
	is the default hugepage size (in Kb).
Hugetlb
@@ -80,6 +84,10 @@ returned to the huge page pool when freed by a task. A user with root
privileges can dynamically allocate more or free some persistent huge pages
by increasing or decreasing the value of ``nr_hugepages``.

Note: When the feature of freeing unused vmemmap pages associated with each
hugetlb page is enabled, we can fail to free the huge pages triggered by
the user when ths system is under memory pressure.  Please try again later.

Pages that are used as huge pages are reserved inside the kernel and cannot
be used for other purposes.  Huge pages cannot be swapped out under
memory pressure.
@@ -145,6 +153,9 @@ default_hugepagesz

	will all result in 256 2M huge pages being allocated.  Valid default
	huge page size is architecture dependent.
hugetlb_free_vmemmap
	When CONFIG_HUGETLB_PAGE_FREE_VMEMMAP is set, this enables freeing
	unused vmemmap pages associated with each HugeTLB page.

When multiple huge page sizes are supported, ``/proc/sys/vm/nr_hugepages``
indicates the current number of pre-allocated huge pages of the default size.
+13 −0
Original line number Diff line number Diff line
@@ -357,6 +357,19 @@ creates ZONE_MOVABLE as following.
   Unfortunately, there is no information to show which memory block belongs
   to ZONE_MOVABLE. This is TBD.

   Memory offlining can fail when dissolving a free huge page on ZONE_MOVABLE
   and the feature of freeing unused vmemmap pages associated with each hugetlb
   page is enabled.

   This can happen when we have plenty of ZONE_MOVABLE memory, but not enough
   kernel memory to allocate vmemmmap pages.  We may even be able to migrate
   huge page contents, but will not be able to dissolve the source huge page.
   This will prevent an offline operation and is unfortunate as memory offlining
   is expected to succeed on movable zones.  Users that depend on memory hotplug
   to succeed for movable zones should carefully consider whether the memory
   savings gained from this feature are worth the risk of possibly not being
   able to offline memory in certain situations.

.. note::
   Techniques that rely on long-term pinnings of memory (especially, RDMA and
   vfio) are fundamentally problematic with ZONE_MOVABLE and, therefore, memory
+2 −0
Original line number Diff line number Diff line
@@ -21,6 +21,8 @@ There are four components to pagemap:
    * Bit  55    pte is soft-dirty (see
      :ref:`Documentation/admin-guide/mm/soft-dirty.rst <soft_dirty>`)
    * Bit  56    page exclusively mapped (since 4.2)
    * Bit  57    pte is uffd-wp write-protected (since 5.13) (see
      :ref:`Documentation/admin-guide/mm/userfaultfd.rst <userfaultfd>`)
    * Bits 57-60 zero
    * Bit  61    page is file-page or shared-anon (since 3.5)
    * Bit  62    page swapped
+2 −1
Original line number Diff line number Diff line
@@ -77,7 +77,8 @@ events, except page fault notifications, may be generated:

- ``UFFD_FEATURE_MINOR_HUGETLBFS`` indicates that the kernel supports
  ``UFFDIO_REGISTER_MODE_MINOR`` registration for hugetlbfs virtual memory
  areas.
  areas. ``UFFD_FEATURE_MINOR_SHMEM`` is the analogous feature indicating
  support for shmem virtual memory areas.

The userland application should set the feature flags it intends to use
when invoking the ``UFFDIO_API`` ioctl, to request that those features be
Loading