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

Merge tag 'mm-stable-2025-06-01-14-06' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull more MM updates from Andrew Morton:

 - "zram: support algorithm-specific parameters" from Sergey Senozhatsky
   adds infrastructure for passing algorithm-specific parameters into
   zram. A single parameter `winbits' is implemented at this time.

 - "memcg: nmi-safe kmem charging" from Shakeel Butt makes memcg
   charging nmi-safe, which is required by BFP, which can operate in NMI
   context.

 - "Some random fixes and cleanup to shmem" from Kemeng Shi implements
   small fixes and cleanups in the shmem code.

 - "Skip mm selftests instead when kernel features are not present" from
   Zi Yan fixes some issues in the MM selftest code.

 - "mm/damon: build-enable essential DAMON components by default" from
   SeongJae Park reworks DAMON Kconfig to make it easier to enable
   CONFIG_DAMON.

 - "sched/numa: add statistics of numa balance task migration" from Libo
   Chen adds more info into sysfs and procfs files to improve visibility
   into the NUMA balancer's task migration activity.

 - "selftests/mm: cow and gup_longterm cleanups" from Mark Brown
   provides various updates to some of the MM selftests to make them
   play better with the overall containing framework.

* tag 'mm-stable-2025-06-01-14-06' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (43 commits)
  mm/khugepaged: clean up refcount check using folio_expected_ref_count()
  selftests/mm: fix test result reporting in gup_longterm
  selftests/mm: report unique test names for each cow test
  selftests/mm: add helper for logging test start and results
  selftests/mm: use standard ksft_finished() in cow and gup_longterm
  selftests/damon/_damon_sysfs: skip testcases if CONFIG_DAMON_SYSFS is disabled
  sched/numa: add statistics of numa balance task
  sched/numa: fix task swap by skipping kernel threads
  tools/testing: check correct variable in open_procmap()
  tools/testing/vma: add missing function stub
  mm/gup: update comment explaining why gup_fast() disables IRQs
  selftests/mm: two fixes for the pfnmap test
  mm/khugepaged: fix race with folio split/free using temporary reference
  mm: add CONFIG_PAGE_BLOCK_ORDER to select page block order
  mmu_notifiers: remove leftover stub macros
  selftests/mm: deduplicate test names in madv_populate
  kcov: rust: add flags for KCOV with Rust
  mm: rust: make CONFIG_MMU ifdefs more narrow
  mmu_gather: move tlb flush for VM_PFNMAP/VM_MIXEDMAP vmas into free_pgtables()
  mm/damon/Kconfig: enable CONFIG_DAMON by default
  ...
parents fe428164 0b43b8bc
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1732,6 +1732,12 @@ The following nested keys are defined.
	  numa_hint_faults (npn)
		Number of NUMA hinting faults.

	  numa_task_migrated (npn)
		Number of task migration by NUMA balancing.

	  numa_task_swapped (npn)
		Number of task swap by NUMA balancing.

	  pgdemote_kswapd
		Number of pages demoted by kswapd.

+2 −2
Original line number Diff line number Diff line
@@ -227,9 +227,9 @@ void __flush_dcache_folio(struct address_space *mapping, struct folio *folio)
	}

	/*
	 * If this is a page cache page, and we have an aliasing VIPT cache,
	 * If this is a page cache folio, and we have an aliasing VIPT cache,
	 * we only need to do one flush - which would be at the relevant
	 * userspace colour, which is congruent with page->index.
	 * userspace colour, which is congruent with folio->index.
	 */
	if (mapping && cache_is_vipt_aliasing())
		flush_pfn_alias(folio_pfn(folio), folio_pos(folio));
+2 −1
Original line number Diff line number Diff line
@@ -105,7 +105,8 @@ static struct list_head ptable_list[3] = {

#define PD_PTABLE(page) ((ptable_desc *)&(virt_to_page((void *)(page))->lru))
#define PD_PAGE(ptable) (list_entry(ptable, struct page, lru))
#define PD_MARKBITS(dp) (*(unsigned int *)&PD_PAGE(dp)->index)
#define PD_PTDESC(ptable) (list_entry(ptable, struct ptdesc, pt_list))
#define PD_MARKBITS(dp) (*(unsigned int *)&PD_PTDESC(dp)->pt_index)

static const int ptable_shift[3] = {
	7+2, /* PGD */
+7 −5
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@
#include "backend_deflate.h"

/* Use the same value as crypto API */
#define DEFLATE_DEF_WINBITS		11
#define DEFLATE_DEF_WINBITS		(-11)
#define DEFLATE_DEF_MEMLEVEL		MAX_MEM_LEVEL

struct deflate_ctx {
@@ -22,8 +22,10 @@ static void deflate_release_params(struct zcomp_params *params)

static int deflate_setup_params(struct zcomp_params *params)
{
	if (params->level == ZCOMP_PARAM_NO_LEVEL)
	if (params->level == ZCOMP_PARAM_NOT_SET)
		params->level = Z_DEFAULT_COMPRESSION;
	if (params->deflate.winbits == ZCOMP_PARAM_NOT_SET)
		params->deflate.winbits = DEFLATE_DEF_WINBITS;

	return 0;
}
@@ -57,13 +59,13 @@ static int deflate_create(struct zcomp_params *params, struct zcomp_ctx *ctx)
		return -ENOMEM;

	ctx->context = zctx;
	sz = zlib_deflate_workspacesize(-DEFLATE_DEF_WINBITS, MAX_MEM_LEVEL);
	sz = zlib_deflate_workspacesize(params->deflate.winbits, MAX_MEM_LEVEL);
	zctx->cctx.workspace = vzalloc(sz);
	if (!zctx->cctx.workspace)
		goto error;

	ret = zlib_deflateInit2(&zctx->cctx, params->level, Z_DEFLATED,
				-DEFLATE_DEF_WINBITS, DEFLATE_DEF_MEMLEVEL,
				params->deflate.winbits, DEFLATE_DEF_MEMLEVEL,
				Z_DEFAULT_STRATEGY);
	if (ret != Z_OK)
		goto error;
@@ -73,7 +75,7 @@ static int deflate_create(struct zcomp_params *params, struct zcomp_ctx *ctx)
	if (!zctx->dctx.workspace)
		goto error;

	ret = zlib_inflateInit2(&zctx->dctx, -DEFLATE_DEF_WINBITS);
	ret = zlib_inflateInit2(&zctx->dctx, params->deflate.winbits);
	if (ret != Z_OK)
		goto error;

+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ static void lz4_release_params(struct zcomp_params *params)

static int lz4_setup_params(struct zcomp_params *params)
{
	if (params->level == ZCOMP_PARAM_NO_LEVEL)
	if (params->level == ZCOMP_PARAM_NOT_SET)
		params->level = LZ4_ACCELERATION_DEFAULT;

	return 0;
Loading