Skip to content

selftests: memcg: Fix test_memcontrol test failures with large page sizes

Waiman Long cgroups linux-kselftest linux-mm lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest7 patches 19 repliesIn review
  2. v17 patches 8 repliesSuperseded

Changes in v2 from the cover letter

- Change vmstats flush threshold scaling from ilog2() to int_sqrt() as suggested by Li Wang
- Fix a number of issues reported by AI review of the patch series

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7memcg: Scale up vmstats flush threshold with int_sqrt(nr_cpus+2)mm/memcontrol.c+13 -57 replies
2/7memcg: Scale down MEMCG_CHARGE_BATCH with increase in PAGE_SIZEinclude/linux/memcontrol.h+7 -12 replies
3/7selftests: memcg: Iterate pages based on the actual page sizetools/testing/selftests/cgroup/test_memcontrol.c+9 -43 replies
4/7selftests: memcg: Increase error tolerance in accordance with page sizetools/testing/selftests/cgroup/lib/include/cgroup_util.h tools/testing/selftests/cgroup/test_memcontrol.c+19 -72 replies
5/7selftests: memcg: Reduce the expected swap.peak with larger page sizetools/testing/selftests/cgroup/test_memcontrol.c+22 -42 replies
6/7selftests: memcg: Don't call reclaim_until() if already in targettools/testing/selftests/cgroup/test_memcontrol.c+10 -11 reply
7/7selftests: memcg: Treat failure for zeroing sock in test_memcg_sock as XFAILtools/testing/selftests/cgroup/test_memcontrol.c+13 -11 reply

Reviews trailers per patch

4 of 7 patches have a Reviewed-by or Acked-by.

PatchLi Wang
1/7R-b
2/7R-b
3/7R-b
4/7
5/7
6/7R-b
7/7

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/7] selftests: memcg: Fix test_memcontrol test failures with large page sizes

v2:
- Change vmstats flush threshold scaling from ilog2() to int_sqrt() as suggested by Li Wang
- Fix a number of issues reported by AI review of the patch series

There are a number of test failures with the running of the test_memcontrol selftest on a 128-core arm64 system on kernels with 4k/16k/64k page sizes. This patch series makes some minor changes to the kernel and the test_memcontrol selftest to address these failures.

The first kernel patch scales the memcg vmstats flush threshold with int_sqrt() instead of linearly with the total number of CPUs. The second kernel patch scale down MEMCG_CHARGE_BATCH with increases in page size. These 2 patches help to reduce the discrepancies between the reported usage data with the real ones.

The next 5 test_memcontrol selftest patches adjust the testing code to greatly reduce the chance that it will report failure, though some occasional failures is still possible.

To verify the changes, the test_memcontrol selftest was run 100 times each on a 128-core arm64 system on kernels with 4k/16k/64k page sizes. No failure was observed other than some failures of the test_memcg_reclaim test when running on a 16k page size kernel. The reclaim_until() call failed because of the unexpected over-reclaim of memory. This will need a further look but it happens with the 16k page size kernel only and I don't have a production ready kernel config file to use in buildinig this 16k page size kernel. The new test_memcontrol selftest and kernel were also run on a 96-core x86 system to make sure there was no regression.

Waiman Long (7):
memcg: Scale up vmstats flush threshold with int_sqrt(nr_cpus+2)
memcg: Scale down MEMCG_CHARGE_BATCH with increase in PAGE_SIZE
selftests: memcg: Iterate pages based on the actual page size
selftests: memcg: Increase error tolerance in accordance with page
size
selftests: memcg: Reduce the expected swap.peak with larger page size
selftests: memcg: Don't call reclaim_until() if already in target
selftests: memcg: Treat failure for zeroing sock in test_memcg_sock as
XFAIL

 include/linux/memcontrol.h                    |  8 +-
 mm/memcontrol.c                               | 18 ++--
 .../cgroup/lib/include/cgroup_util.h          |  3 +-
 .../selftests/cgroup/test_memcontrol.c        | 87 +++++++++++++++----
 4 files changed, 93 insertions(+), 23 deletions(-)
Signature · 1 line
2.53.0