device-drivers/zram01: Fix failures on ppc64le
RFC PATCH 1/1 device-drivers/zram01: Fix failures on ppc64le
The Btrfs filesystem on ppc64le needs at least 139MB due to larger page size. Unfortunately the minimal size reported by mkfs.btrfs does not seem to be correct in all cases so this patch simply bumps the device size to 384MB which should be more than enough.
We also check that there is at least 1GB of RAM now and default to 25MB and ext2 instead of Btrfs in order not to fail the test on a tiny machines.
--- testcases/kernel/device-drivers/zram/zram01.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-)
testcases/kernel/device-drivers/zram/zram01.sh +13 -4
@@ -32,6 +32,16 @@ dev_num=4 # Number of items must be equal to 'dev_num' parameter. zram_max_streams="2 3 5 8" +FS_SIZE="402653184" +FS_TYPE="btrfs" + +RAM_SIZE=$(awk '/MemTotal:/ {print $2}' /proc/meminfo) +if [ "$RAM_SIZE" -lt 1048576 ]; then + tst_res TINFO "Not enough space for Btrfs" + FS_SIZE="26214400" + FS_TYPE="ext2" +fi + # The zram sysfs node 'disksize' value can be either in bytes, # or you can use mem suffixes. But in some old kernels, mem # suffixes are not supported, for example, in RHEL6.6GA's kernel
@@ -39,9 +49,9 @@ zram_max_streams="2 3 5 8" # not support mem suffixes, in some newer kernels, they use # memparse() which supports mem suffixes. So here we just use # bytes to make sure everything works correctly. -zram_sizes="26214400 26214400 26214400 41943040" # 25MB, 40MB for btrfs -zram_mem_limits="25M 25M 25M 40M" -zram_filesystems="ext3 ext4 xfs btrfs" +zram_sizes="26214400 26214400 26214400 $FS_SIZE" +zram_mem_limits="25M 25M 25M $((FS_SIZE/1024/1024))M" +zram_filesystems="ext3 ext4 xfs $FS_TYPE" zram_algs="lzo lzo lzo lzo" TST_CLEANUP="zram_cleanup"
@@ -91,7 +101,6 @@ zram_set_disksizes zram_set_memlimit zram_makefs zram_mount - zram_fill_fs tst_exit
Signature · 1 line
2.13.0
RFC PATCH 1/1 device-drivers/zram01: Fix failures on ppc64le
Hi!
Ping, any comments to this patch?
Signature · 2 lines
Cyril Hrubis [email protected]
RFC PATCH 1/1 device-drivers/zram01: Fix failures on ppc64le
----- Original Message -----
Quoted 2 lines
Hi!
Ping, any comments to this patch?
I don't see other options at the moment. We need to pick some sane size, since number from mkfs is not reliable.
Regards,
Jan
RFC PATCH 1/1 device-drivers/zram01: Fix failures on ppc64le
Hi!
Quoted 5 lines
Quoted 2 lines
Hi!
Ping, any comments to this patch?I don't see other options at the moment. We need to pick some sane size, since number from mkfs is not reliable.
Pushed with your ack.
Signature · 2 lines
Cyril Hrubis [email protected]