fs/iomap/direct-io: pass NOWAIT to bio flags
Subsystems (3)
RFC PATCH 1/2 fs/iomap/direct-io: pass NOWAIT to bio flags
This is required to avoid waiting in lower layers.
--- fs/iomap/direct-io.c | 2 ++ 1 file changed, 2 insertions(+)
fs/iomap/direct-io.c +2 -0
@@ -63,6 +63,8 @@ static void iomap_dio_submit_bio(struct iomap_dio *dio, struct iomap *iomap, {atomic_inc (&dio->ref); +if (dio->iocb->ki_flags &IOCB_NOWAIT ) + bio->bi_opf |=REQ_NOWAIT ;if (dio->iocb->ki_flags &IOCB_HIPRI )bio_set_polled (bio, dio->iocb);
RFC PATCH 2/2 fs/direct-io: pass NOWAIT to also for read requests
For some reason NOWAIT currently is passed only for writes.
--- fs/direct-io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/direct-io.c +2 -2
@@ -1234,11 +1234,11 @@ do_blockdev_direct_IO(struct kiocb *iocb, struct inode *inode,if (iov_iter_rw (iter) ==WRITE ) { dio->op =REQ_OP_WRITE ; dio->op_flags =REQ_SYNC |REQ_IDLE ; -if (iocb->ki_flags &IOCB_NOWAIT ) - dio->op_flags |=REQ_NOWAIT ; }else { dio->op =REQ_OP_READ ; } +if (iocb->ki_flags &IOCB_NOWAIT ) + dio->op_flags |=REQ_NOWAIT ;if (iocb->ki_flags &IOCB_HIPRI ) dio->op_flags |=REQ_HIPRI ;
Re: [PATCH RFC 2/2] fs/direct-io: pass NOWAIT to also for read requests
Quoted 4 lines · Konstantin Khlebnikov
For some reason NOWAIT currently is passed only for writes.
Signed-off-by Konstantin Khlebnikov <[email protected]>Fixes 03a07c92a9ed ("block: return on congested block device")
Looks good,
Quoted 3 lines · Konstantin Khlebnikov
This is required to avoid waiting in lower layers.
Signed-off-by Konstantin Khlebnikov <[email protected]>
This looks sensible. Did you run this through xfstests?
Quoted 7 lines · Christoph Hellwig
Quoted 3 lines · Konstantin Khlebnikov
This is required to avoid waiting in lower layers.
Signed-off-by Konstantin Khlebnikov <[email protected]>This looks sensible. Did you run this through xfstests?
Nope. It seems xfstests has one trivial test for NOWAIT - generic/471 It tests only write with/without extent, nothing about contention.
I've added nowait into fio and played with it a little.
https://github.com/axboe/fio/pull/972
With these patches I see EAGAINs when queue is flooded.
Quoted 9 lines · Konstantin Khlebnikov
Quoted 7 lines · Christoph Hellwig
Quoted 3 lines · Konstantin Khlebnikov
This is required to avoid waiting in lower layers.
Signed-off-by Konstantin Khlebnikov <[email protected]>This looks sensible. Did you run this through xfstests?
Quoted 7 lines
Nope. It seems xfstests has one trivial test for NOWAIT - generic/471 It tests only write with/without extent, nothing about contention.
I've added nowait into fio and played with it a little.
https://github.com/axboe/fio/pull/972With these patches I see EAGAINs when queue is flooded.
Once the fio changes land, can you add a simple fio based test to xfstests?
Quoted 3 lines · Konstantin Khlebnikov
This is required to avoid waiting in lower layers.
Signed-off-by Konstantin Khlebnikov <[email protected]>
Looks good,