Commit 98931dd9 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'mm-stable-2022-05-25' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull MM updates from Andrew Morton:
 "Almost all of MM here. A few things are still getting finished off,
  reviewed, etc.

   - Yang Shi has improved the behaviour of khugepaged collapsing of
     readonly file-backed transparent hugepages.

   - Johannes Weiner has arranged for zswap memory use to be tracked and
     managed on a per-cgroup basis.

   - Munchun Song adds a /proc knob ("hugetlb_optimize_vmemmap") for
     runtime enablement of the recent huge page vmemmap optimization
     feature.

   - Baolin Wang contributes a series to fix some issues around hugetlb
     pagetable invalidation.

   - Zhenwei Pi has fixed some interactions between hwpoisoned pages and
     virtualization.

   - Tong Tiangen has enabled the use of the presently x86-only
     page_table_check debugging feature on arm64 and riscv.

   - David Vernet has done some fixup work on the memcg selftests.

   - Peter Xu has taught userfaultfd to handle write protection faults
     against shmem- and hugetlbfs-backed files.

   - More DAMON development from SeongJae Park - adding online tuning of
     the feature and support for monitoring of fixed virtual address
     ranges. Also easier discovery of which monitoring operations are
     available.

   - Nadav Amit has done some optimization of TLB flushing during
     mprotect().

   - Neil Brown continues to labor away at improving our swap-over-NFS
     support.

   - David Hildenbrand has some fixes to anon page COWing versus
     get_user_pages().

   - Peng Liu fixed some errors in the core hugetlb code.

   - Joao Martins has reduced the amount of memory consumed by
     device-dax's compound devmaps.

   - Some cleanups of the arch-specific pagemap code from Anshuman
     Khandual.

   - Muchun Song has found and fixed some errors in the TLB flushing of
     transparent hugepages.

   - Roman Gushchin has done more work on the memcg selftests.

  ... and, of course, many smaller fixes and cleanups. Notably, the
  customary million cleanup serieses from Miaohe Lin"

* tag 'mm-stable-2022-05-25' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (381 commits)
  mm: kfence: use PAGE_ALIGNED helper
  selftests: vm: add the "settings" file with timeout variable
  selftests: vm: add "test_hmm.sh" to TEST_FILES
  selftests: vm: check numa_available() before operating "merge_across_nodes" in ksm_tests
  selftests: vm: add migration to the .gitignore
  selftests/vm/pkeys: fix typo in comment
  ksm: fix typo in comment
  selftests: vm: add process_mrelease tests
  Revert "mm/vmscan: never demote for memcg reclaim"
  mm/kfence: print disabling or re-enabling message
  include/trace/events/percpu.h: cleanup for "percpu: improve percpu_alloc_percpu event trace"
  include/trace/events/mmflags.h: cleanup for "tracing: incorrect gfp_t conversion"
  mm: fix a potential infinite loop in start_isolate_page_range()
  MAINTAINERS: add Muchun as co-maintainer for HugeTLB
  zram: fix Kconfig dependency warning
  mm/shmem: fix shmem folio swapoff hang
  cgroup: fix an error handling path in alloc_pagecache_max_30M()
  mm: damon: use HPAGE_PMD_SIZE
  tracing: incorrect isolate_mote_t cast in mm_vmscan_lru_isolate
  nodemask.h: fix compilation error with GCC12
  ...
parents df202b45 f403f22f
Loading
Loading
Loading
Loading
+18 −7
Original line number Diff line number Diff line
@@ -23,9 +23,10 @@ Date: Mar 2022
Contact:	SeongJae Park <sj@kernel.org>
Description:	Writing 'on' or 'off' to this file makes the kdamond starts or
		stops, respectively.  Reading the file returns the keywords
		based on the current status.  Writing 'update_schemes_stats' to
		the file updates contents of schemes stats files of the
		kdamond.
		based on the current status.  Writing 'commit' to this file
		makes the kdamond reads the user inputs in the sysfs files
		except 'state' again.  Writing 'update_schemes_stats' to the
		file updates contents of schemes stats files of the kdamond.

What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/pid
Date:		Mar 2022
@@ -40,14 +41,24 @@ Description: Writing a number 'N' to this file creates the number of
		directories for controlling each DAMON context named '0' to
		'N-1' under the contexts/ directory.

What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/avail_operations
Date:		Apr 2022
Contact:	SeongJae Park <sj@kernel.org>
Description:	Reading this file returns the available monitoring operations
		sets on the currently running kernel.

What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/operations
Date:		Mar 2022
Contact:	SeongJae Park <sj@kernel.org>
Description:	Writing a keyword for a monitoring operations set ('vaddr' for
		virtual address spaces monitoring, and 'paddr' for the physical
		address space monitoring) to this file makes the context to use
		the operations set.  Reading the file returns the keyword for
		the operations set the context is set to use.
		virtual address spaces monitoring, 'fvaddr' for fixed virtual
		address ranges monitoring, and 'paddr' for the physical address
		space monitoring) to this file makes the context to use the
		operations set.  Reading the file returns the keyword for the
		operations set the context is set to use.

		Note that only the operations sets that listed in
		'avail_operations' file are valid inputs.

What:		/sys/kernel/mm/damon/admin/kdamonds/<K>/contexts/<C>/monitoring_attrs/intervals/sample_us
Date:		Mar 2022
+5 −0
Original line number Diff line number Diff line
@@ -343,6 +343,11 @@ Admin can request writeback of those idle pages at right timing via::

With the command, zram will writeback idle pages from memory to the storage.

Additionally, if a user choose to writeback only huge and idle pages
this can be accomplished with::

        echo huge_idle > /sys/block/zramX/writeback

If an admin wants to write a specific page in zram device to the backing device,
they could write a page index into the interface.

+49 −0
Original line number Diff line number Diff line
@@ -1208,6 +1208,34 @@ PAGE_SIZE multiple when read back.
	high limit is used and monitored properly, this limit's
	utility is limited to providing the final safety net.

  memory.reclaim
	A write-only nested-keyed file which exists for all cgroups.

	This is a simple interface to trigger memory reclaim in the
	target cgroup.

	This file accepts a single key, the number of bytes to reclaim.
	No nested keys are currently supported.

	Example::

	  echo "1G" > memory.reclaim

	The interface can be later extended with nested keys to
	configure the reclaim behavior. For example, specify the
	type of memory to reclaim from (anon, file, ..).

	Please note that the kernel can over or under reclaim from
	the target cgroup. If less bytes are reclaimed than the
	specified amount, -EAGAIN is returned.

  memory.peak
	A read-only single value file which exists on non-root
	cgroups.

	The max memory usage recorded for the cgroup and its
	descendants since the creation of the cgroup.

  memory.oom.group
	A read-write single value file which exists on non-root
	cgroups.  The default value is "0".
@@ -1326,6 +1354,12 @@ PAGE_SIZE multiple when read back.
		Amount of cached filesystem data that is swap-backed,
		such as tmpfs, shm segments, shared anonymous mmap()s

	  zswap
		Amount of memory consumed by the zswap compression backend.

	  zswapped
		Amount of application memory swapped out to zswap.

	  file_mapped
		Amount of cached filesystem data mapped with mmap()

@@ -1516,6 +1550,21 @@ PAGE_SIZE multiple when read back.
	higher than the limit for an extended period of time.  This
	reduces the impact on the workload and memory management.

  memory.zswap.current
	A read-only single value file which exists on non-root
	cgroups.

	The total amount of memory consumed by the zswap compression
	backend.

  memory.zswap.max
	A read-write single value file which exists on non-root
	cgroups.  The default is "max".

	Zswap usage hard limit. If a cgroup's zswap pool reaches this
	limit, it will refuse to take any more stores before existing
	entries fault back in or are written out to disk.

  memory.pressure
	A read-only nested-keyed file.

+5 −5
Original line number Diff line number Diff line
@@ -1705,16 +1705,16 @@
			boot-time allocation of gigantic hugepages is skipped.

	hugetlb_free_vmemmap=
			[KNL] Reguires CONFIG_HUGETLB_PAGE_FREE_VMEMMAP
			[KNL] Reguires CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP
			enabled.
			Allows heavy hugetlb users to free up some more
			memory (7 * PAGE_SIZE for each 2MB hugetlb page).
			Format: { on | off (default) }
			Format: { [oO][Nn]/Y/y/1 | [oO][Ff]/N/n/0 (default) }

			on:  enable the feature
			off: disable the feature
			[oO][Nn]/Y/y/1: enable the feature
			[oO][Ff]/N/n/0: disable the feature

			Built with CONFIG_HUGETLB_PAGE_FREE_VMEMMAP_DEFAULT_ON=y,
			Built with CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON=y,
			the default is on.

			This is not compatible with memory_hotplug.memmap_on_memory.
+11 −0
Original line number Diff line number Diff line
@@ -66,6 +66,17 @@ Setting it as ``N`` disables DAMON_RECLAIM. Note that DAMON_RECLAIM could do
no real monitoring and reclamation due to the watermarks-based activation
condition.  Refer to below descriptions for the watermarks parameter for this.

commit_inputs
-------------

Make DAMON_RECLAIM reads the input parameters again, except ``enabled``.

Input parameters that updated while DAMON_RECLAIM is running are not applied
by default.  Once this parameter is set as ``Y``, DAMON_RECLAIM reads values
of parametrs except ``enabled`` again.  Once the re-reading is done, this
parameter is set as ``N``.  If invalid parameters are found while the
re-reading, DAMON_RECLAIM will be disabled.

min_age
-------

Loading