OSDN Git Service

selftests: vm: check numa_available() before operating "merge_across_nodes" in ksm_tests
authorPatrick Wang <patrick.wang.shcn@gmail.com>
Sat, 21 May 2022 08:38:23 +0000 (16:38 +0800)
committerakpm <akpm@linux-foundation.org>
Wed, 25 May 2022 17:47:49 +0000 (10:47 -0700)
commit9aa1af954db02a3228763015356684a169503c68
tree24f32b1256a3c2c2aa67457ae6041cd6eeb85dbf
parent3d3921ed271b0e23d60c91fcad089f2f5e71af98
selftests: vm: check numa_available() before operating "merge_across_nodes" in ksm_tests

Patch series "selftests: vm: a few fixup patches".

This series contains three fixup patches for vm selftests.  They are
independent.  Please see the patches.

This patch (of 3):

Currently, ksm_tests operates "merge_across_nodes" with NUMA either
enabled or disabled.  In a system with NUMA disabled, these operations
will fail and output a misleading report given "merge_across_nodes" does
not exist in sysfs:

  ----------------------------
  running ./ksm_tests -M -p 10
  ----------------------------
  f /sys/kernel/mm/ksm/merge_across_nodes
  fopen: No such file or directory
  Cannot save default tunables
  [FAIL]
  ----------------------

So check numa_available() before those operations to skip them if NUMA is
disabled.

Link: https://lkml.kernel.org/r/20220521083825.319654-1-patrick.wang.shcn@gmail.com
Link: https://lkml.kernel.org/r/20220521083825.319654-2-patrick.wang.shcn@gmail.com
Signed-off-by: Patrick Wang <patrick.wang.shcn@gmail.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/selftests/vm/ksm_tests.c