Skip to content

Commit

Permalink
selftests/vm: fix display of page size in map_hugetlb
Browse files Browse the repository at this point in the history
[ Upstream commit 1ec882fc81e3177faf055877310dbdb0c68eb7db ]

The displayed size is in bytes while the text says it is in kB.

Shift it by 10 to really display kBytes.

Fixes: fa7b9a805c79 ("tools/selftest/vm: allow choosing mem size and page size in map_hugetlb")
Signed-off-by: Christophe Leroy <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Cc: <[email protected]>
Link: https://lkml.kernel.org/r/e27481224564a93d14106e750de31189deaa8bc8.1598861977.git.christophe.leroy@csgroup.eu
Signed-off-by: Linus Torvalds <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
chleroy authored and AK-Papon committed Mar 16, 2024
1 parent 49f8925 commit 194df75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/vm/map_hugetlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ int main(int argc, char **argv)
}

if (shift)
printf("%u kB hugepages\n", 1 << shift);
printf("%u kB hugepages\n", 1 << (shift - 10));
else
printf("Default size hugepages\n");
printf("Mapping %lu Mbytes\n", (unsigned long)length >> 20);
Expand Down

0 comments on commit 194df75

Please sign in to comment.