]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selftests/mm: run_vmtests.sh: fix hugetlb mem size calculation
authorPeter Xu <peterx@redhat.com>
Thu, 21 Mar 2024 21:50:47 +0000 (17:50 -0400)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 26 Apr 2024 03:56:02 +0000 (20:56 -0700)
commit2e47a445d7b3904d0dd6a1401357e3d5ac1a6440
treead09c6989e62ad4444da358bdbcae01a688b457c
parent64c2e895df14c642fbb05e5ac7f55044cd4913a3
selftests/mm: run_vmtests.sh: fix hugetlb mem size calculation

The script calculates a mininum required size of hugetlb memories, but
it'll stop working with <1MB huge page sizes, reporting all zeros even if
huge pages are available.

In reality, the calculation doesn't really need to be as complicated
either.  Make it simpler and work for KB-level hugepages too.

[peterx@redhat.com: run_vmtests.sh: fix hugetlb mem size calculation]
Link: https://lkml.kernel.org/r/20240403200324.1603493-1-peterx@redhat.com
Link: https://lkml.kernel.org/r/20240321215047.678172-1-peterx@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Muchun Song <muchun.song@linux.dev>
Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Tested-by: Ryan Roberts <ryan.roberts@arm.com>
Cc: Nico Pache <npache@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/selftests/mm/run_vmtests.sh