selftests/vm/run_vmtests: adjust hugetlb size according to nr_cpus
authorLi Zhijian <[email protected]>
Fri, 9 Mar 2018 23:51:16 +0000 (15:51 -0800)
committerLinus Torvalds <[email protected]>
Sat, 10 Mar 2018 00:40:01 +0000 (16:40 -0800)
commit0627be7d3c871035364923559543c9b2ff5357f2
tree5b861c8c86bafb67e3f9283b95e6fedc3165a54d
parent864b75f9d6b0100bb24fdd9a20d156e7cda9b5ae
selftests/vm/run_vmtests: adjust hugetlb size according to nr_cpus

Fix userfaultfd_hugetlb on hosts which have more than 64 cpus.

  ---------------------------
  running userfaultfd_hugetlb
  ---------------------------
  invalid MiB
  Usage: <MiB> <bounces>
  [FAIL]

Via userfaultfd.c we can know, hugetlb_size needs to meet hugetlb_size
>= nr_cpus * hugepage_size.  hugepage_size is often 2M, so when host
cpus > 64, it requires more than 128M.

[[email protected]: update changelog/comments and variable name]
Link: http://lkml.kernel.org/r/[email protected]
Link: http://lkml.kernel.org/r/[email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Li Zhijian <[email protected]>
Cc: Shuah Khan <[email protected]>
Cc: SeongJae Park <[email protected]>
Cc: Philippe Ombredanne <[email protected]>
Cc: Aneesh Kumar K.V <[email protected]>
Cc: Mike Kravetz <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
tools/testing/selftests/vm/run_vmtests