All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] generic/095: don't use 1k blocksize for DIO operations
@ 2021-10-11 13:55 Luís Henriques
  2021-10-11 14:36 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Luís Henriques @ 2021-10-11 13:55 UTC (permalink / raw)
  To: fstests
  Cc: Ming Lei, Zorro Lang, Theodore Ts'o, Jens Axboe, Luís Henriques

This test fails when using zram because it's using bs=1k for DIO in fio
jobs.  Fix the test by using _min_dio_alignment instead to get the correct
blocksize.

Signed-off-by: Luís Henriques <lhenriques@suse.de>
---
 tests/generic/095 | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/generic/095 b/tests/generic/095
index c4693917b3e1..80448200bb86 100755
--- a/tests/generic/095
+++ b/tests/generic/095
@@ -23,6 +23,7 @@ iodepth_batch=$((8 * LOAD_FACTOR))
 numjobs=$((5 * LOAD_FACTOR))
 fio_config=$tmp.fio
 fio_out=$tmp.fio.out
+blksz=$(_min_dio_alignment $SCRATCH_DEV)
 cat >$fio_config <<EOF
 [global]
 bs=8k
@@ -34,7 +35,7 @@ directory=$SCRATCH_MNT
 numjobs=$numjobs
 [job1]
 ioengine=sync
-bs=1k
+bs=$blksz
 direct=1
 rw=randread
 filename=file1:file2
@@ -44,7 +45,7 @@ rw=randwrite
 direct=1
 filename=file1:file2
 [job3]
-bs=1k
+bs=$blksz
 ioengine=posixaio
 rw=randwrite
 direct=1

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

* Re: [PATCH] generic/095: don't use 1k blocksize for DIO operations
  2021-10-11 13:55 [PATCH] generic/095: don't use 1k blocksize for DIO operations Luís Henriques
@ 2021-10-11 14:36 ` Theodore Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2021-10-11 14:36 UTC (permalink / raw)
  To: Luís Henriques; +Cc: fstests, Ming Lei, Zorro Lang, Jens Axboe

On Mon, Oct 11, 2021 at 02:55:04PM +0100, Luís Henriques wrote:
> This test fails when using zram because it's using bs=1k for DIO in fio
> jobs.  Fix the test by using _min_dio_alignment instead to get the correct
> blocksize.
> 
> Signed-off-by: Luís Henriques <lhenriques@suse.de>

I'd suggest using the commit summary:

generic/095: align DIO read/writes with the supported sector size for the device

It might also be worth noting that generic/095 would have been failing
not just for zram, but if run on other hardware devices that might
have a logical sector size > 1k --- e.g., advanced format HDD's with
4k sectors, DASD's on mainframes with 2k sectors, etc.

Note: this change will cause the fio stress workload to do its DIO
operations using a block size of 512, which I think is fine for this
test.  (There might be other tests which are making assumptions about
the supported DIO alignment of the scratch device where adjusting the
test might be more complicated; fortunately, this doesn't appear to be
one of them.)

Other than changes to the commit description, feel free to add:

Reviewed-by: Theodore Ts'o <tytso@mit.edu>

Thanks,

					- Ted

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

end of thread, other threads:[~2021-10-11 14:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-11 13:55 [PATCH] generic/095: don't use 1k blocksize for DIO operations Luís Henriques
2021-10-11 14:36 ` Theodore Ts'o

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.