[PATCH] kselftests/cgroup: adjust memcg charge batch size

From: Roman Gushchin
Date: Thu Dec 01 2022 - 21:05:07 EST


Commit 1813e51eece0 ("memcg: increase MEMCG_CHARGE_BATCH to 64")
doubled the memcg charge batch size, which broke the kmem_memcg_deletion
test. Bump the corresponding error margin on the test side to fix the
problem.

Reported-by: kernel test robot <yujie.liu@xxxxxxxxx>
Link: https://lore.kernel.org/oe-lkp/202212010958.c1053bd3-yujie.liu@xxxxxxxxx
Fixes: 1813e51eece0 ("memcg: increase MEMCG_CHARGE_BATCH to 64")
Signed-off-by: Roman Gushchin <roman.gushchin@xxxxxxxxx>
Cc: Michal Hocko <mhocko@xxxxxxxx>
Cc: Shakeel Butt <shakeelb@xxxxxxxxxx>
---
tools/testing/selftests/cgroup/test_kmem.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/cgroup/test_kmem.c b/tools/testing/selftests/cgroup/test_kmem.c
index 22b31ebb3513..258ddc565deb 100644
--- a/tools/testing/selftests/cgroup/test_kmem.c
+++ b/tools/testing/selftests/cgroup/test_kmem.c
@@ -19,12 +19,12 @@


/*
- * Memory cgroup charging is performed using percpu batches 32 pages
+ * Memory cgroup charging is performed using percpu batches 64 pages
* big (look at MEMCG_CHARGE_BATCH), whereas memory.stat is exact. So
* the maximum discrepancy between charge and vmstat entries is number
- * of cpus multiplied by 32 pages.
+ * of cpus multiplied by 64 pages.
*/
-#define MAX_VMSTAT_ERROR (4096 * 32 * get_nprocs())
+#define MAX_VMSTAT_ERROR (4096 * 64 * get_nprocs())


static int alloc_dcache(const char *cgroup, void *arg)
--
2.38.1