All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [RFC] [PATCH] device-drivers/zram01: Fix failures on ppc64le
@ 2017-08-21 14:07 Cyril Hrubis
  2017-08-29 11:26 ` Cyril Hrubis
  0 siblings, 1 reply; 4+ messages in thread
From: Cyril Hrubis @ 2017-08-21 14:07 UTC (permalink / raw)
  To: ltp

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.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
 testcases/kernel/device-drivers/zram/zram01.sh | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/testcases/kernel/device-drivers/zram/zram01.sh b/testcases/kernel/device-drivers/zram/zram01.sh
index 64284d554..82e9f121b 100755
--- a/testcases/kernel/device-drivers/zram/zram01.sh
+++ b/testcases/kernel/device-drivers/zram/zram01.sh
@@ -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
-- 
2.13.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [LTP] [RFC] [PATCH] device-drivers/zram01: Fix failures on ppc64le
  2017-08-21 14:07 [LTP] [RFC] [PATCH] device-drivers/zram01: Fix failures on ppc64le Cyril Hrubis
@ 2017-08-29 11:26 ` Cyril Hrubis
  2017-08-29 15:07   ` Jan Stancek
  0 siblings, 1 reply; 4+ messages in thread
From: Cyril Hrubis @ 2017-08-29 11:26 UTC (permalink / raw)
  To: ltp

Hi!
Ping, any comments to this patch?

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [LTP] [RFC] [PATCH] device-drivers/zram01: Fix failures on ppc64le
  2017-08-29 11:26 ` Cyril Hrubis
@ 2017-08-29 15:07   ` Jan Stancek
  2017-08-29 15:25     ` Cyril Hrubis
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Stancek @ 2017-08-29 15:07 UTC (permalink / raw)
  To: ltp



----- Original Message -----
> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [LTP] [RFC] [PATCH] device-drivers/zram01: Fix failures on ppc64le
  2017-08-29 15:07   ` Jan Stancek
@ 2017-08-29 15:25     ` Cyril Hrubis
  0 siblings, 0 replies; 4+ messages in thread
From: Cyril Hrubis @ 2017-08-29 15:25 UTC (permalink / raw)
  To: ltp

Hi!
> > 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.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-08-29 15:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-21 14:07 [LTP] [RFC] [PATCH] device-drivers/zram01: Fix failures on ppc64le Cyril Hrubis
2017-08-29 11:26 ` Cyril Hrubis
2017-08-29 15:07   ` Jan Stancek
2017-08-29 15:25     ` Cyril Hrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.