mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-02 07:13:31 +01:00
selftests/mm: save and restore nr_hugepages value
Save and restore nr_hugepages before changing it during the test. A test should not change system wide settings. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Muhammad Usama Anjum <[email protected]> Cc: Ryan Roberts <[email protected]> Cc: Shuah Khan <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
This commit is contained in:
1 parent
20a2191c2e
commit
7d695b1c36
2 files changed
+7
No files matched your search
@@ -11,6 +11,8 @@ if [[ $(id -u) -ne 0 ]]; then
|
||||
exit $ksft_skip
|
||||
fi
|
||||
|
||||
nr_hugepgs=$(cat /proc/sys/vm/nr_hugepages)
|
||||
|
||||
fault_limit_file=limit_in_bytes
|
||||
reservation_limit_file=rsvd.limit_in_bytes
|
||||
fault_usage_file=usage_in_bytes
|
||||
@@ -582,3 +584,5 @@ if [[ $do_umount ]]; then
|
||||
umount $cgroup_path
|
||||
rmdir $cgroup_path
|
||||
fi
|
||||
|
||||
echo "$nr_hugepgs" > /proc/sys/vm/nr_hugepages
|
||||
@@ -11,6 +11,7 @@ if [[ $(id -u) -ne 0 ]]; then
|
||||
exit $ksft_skip
|
||||
fi
|
||||
|
||||
nr_hugepgs=$(cat /proc/sys/vm/nr_hugepages)
|
||||
usage_file=usage_in_bytes
|
||||
|
||||
if [[ "$1" == "-cgroup-v2" ]]; then
|
||||
@@ -252,3 +253,5 @@ if [[ $do_umount ]]; then
|
||||
umount $CGROUP_ROOT
|
||||
rm -rf $CGROUP_ROOT
|
||||
fi
|
||||
|
||||
echo "$nr_hugepgs" > /proc/sys/vm/nr_hugepages
|
||||
Reference in new issue
Block a user