Skip to contentSkip to conversation

selftests-cgroup-fix-hardcoded-page-size-in-test_percpu_basic.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message May 29

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: selftests/cgroup: fix hardcoded page size in test_percpu_basic
has been removed from the -mm tree. Its filename was
selftests-cgroup-fix-hardcoded-page-size-in-test_percpu_basic.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Li Wang <[email protected]>
Subject: selftests/cgroup: fix hardcoded page size in test_percpu_basic
Date: Fri, 1 May 2026 10:20:57 +0800

Patch series "selftests/cgroup: Fix false positive failures in test_percpu_basic", v2.

This patch series addresses two separate issues that cause false positive failures in the test_percpu_basic test within the cgroup kmem selftests.

The first issue stems from a hardcoded assumption about the system page size, which breaks the test on architectures with larger page sizes.

The second issue is an overly strict memory check that fails to account for the slab metadata allocated during cgroup creation.

This patch (of 2):

MAX_VMSTAT_ERROR uses a hardcoded page size of 4096, which assumes 4K pages. This causes test_percpu_basic to fail on systems where the kernel is configured with a larger page size, such as aarch64 systems using 16K or 64K pages, where the maximum permissible discrepancy between memory.current and percpu charges is proportionally larger.

Replace the hardcoded 4096 with sysconf(_SC_PAGESIZE) to correctly derive the page size at runtime regardless of the underlying architecture or kernel configuration.

---

 tools/testing/selftests/cgroup/test_kmem.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/cgroup/test_kmem.c renamed from tools/testing/selftests/cgroup/test_kmem.c~selftests-cgroup-fix-hardcoded-page-size-in-test_percpu_basic +1 -1
@@ -24,7 +24,7 @@
  * the maximum discrepancy between charge and vmstat entries is number
  * of cpus multiplied by 64 pages.
  */
-#define MAX_VMSTAT_ERROR (4096 * 64 * get_nprocs())
+#define MAX_VMSTAT_ERROR (sysconf(_SC_PAGESIZE) * 64 * get_nprocs())
 
 #define KMEM_DEAD_WAIT_RETRIES        80
 

_

Patches currently in -mm which might be from [email protected] are