* [PATCH RFC 1/2] fs/iomap/direct-io: pass NOWAIT to bio flags
@ 2020-05-04 15:54 Konstantin Khlebnikov
2020-05-04 15:54 ` [PATCH RFC 2/2] fs/direct-io: pass NOWAIT to also for read requests Konstantin Khlebnikov
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Konstantin Khlebnikov @ 2020-05-04 15:54 UTC (permalink / raw)
To: linux-kernel, linux-block; +Cc: Jens Axboe, Christoph Hellwig
This is required to avoid waiting in lower layers.
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
---
fs/iomap/direct-io.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c
index 20dde5aadcdd..9b53fa7651e3 100644
--- a/fs/iomap/direct-io.c
+++ b/fs/iomap/direct-io.c
@@ -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);
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH RFC 2/2] fs/direct-io: pass NOWAIT to also for read requests
2020-05-04 15:54 [PATCH RFC 1/2] fs/iomap/direct-io: pass NOWAIT to bio flags Konstantin Khlebnikov
@ 2020-05-04 15:54 ` Konstantin Khlebnikov
2020-05-06 14:40 ` Christoph Hellwig
2020-05-04 16:00 ` [PATCH RFC 1/2] fs/iomap/direct-io: pass NOWAIT to bio flags Christoph Hellwig
2020-05-06 14:40 ` Christoph Hellwig
2 siblings, 1 reply; 7+ messages in thread
From: Konstantin Khlebnikov @ 2020-05-04 15:54 UTC (permalink / raw)
To: linux-kernel, linux-block; +Cc: Jens Axboe, Christoph Hellwig
For some reason NOWAIT currently is passed only for writes.
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Fixes: 03a07c92a9ed ("block: return on congested block device")
---
fs/direct-io.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/direct-io.c b/fs/direct-io.c
index 00b4d15bb811..dbb6afef6be9 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -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;
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH RFC 1/2] fs/iomap/direct-io: pass NOWAIT to bio flags
2020-05-04 15:54 [PATCH RFC 1/2] fs/iomap/direct-io: pass NOWAIT to bio flags Konstantin Khlebnikov
2020-05-04 15:54 ` [PATCH RFC 2/2] fs/direct-io: pass NOWAIT to also for read requests Konstantin Khlebnikov
@ 2020-05-04 16:00 ` Christoph Hellwig
2020-05-04 16:23 ` Konstantin Khlebnikov
2020-05-06 14:40 ` Christoph Hellwig
2 siblings, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2020-05-04 16:00 UTC (permalink / raw)
To: Konstantin Khlebnikov
Cc: linux-kernel, linux-block, Jens Axboe, Christoph Hellwig
On Mon, May 04, 2020 at 06:54:53PM +0300, Konstantin Khlebnikov wrote:
> This is required to avoid waiting in lower layers.
>
> Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
This looks sensible. Did you run this through xfstests?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH RFC 1/2] fs/iomap/direct-io: pass NOWAIT to bio flags
2020-05-04 16:00 ` [PATCH RFC 1/2] fs/iomap/direct-io: pass NOWAIT to bio flags Christoph Hellwig
@ 2020-05-04 16:23 ` Konstantin Khlebnikov
2020-05-06 14:40 ` Christoph Hellwig
0 siblings, 1 reply; 7+ messages in thread
From: Konstantin Khlebnikov @ 2020-05-04 16:23 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-kernel, linux-block, Jens Axboe
On 04/05/2020 19.00, Christoph Hellwig wrote:
> On Mon, May 04, 2020 at 06:54:53PM +0300, Konstantin Khlebnikov wrote:
>> This is required to avoid waiting in lower layers.
>>
>> Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
>
> 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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH RFC 1/2] fs/iomap/direct-io: pass NOWAIT to bio flags
2020-05-04 16:23 ` Konstantin Khlebnikov
@ 2020-05-06 14:40 ` Christoph Hellwig
0 siblings, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2020-05-06 14:40 UTC (permalink / raw)
To: Konstantin Khlebnikov
Cc: Christoph Hellwig, linux-kernel, linux-block, Jens Axboe
On Mon, May 04, 2020 at 07:23:50PM +0300, Konstantin Khlebnikov wrote:
> On 04/05/2020 19.00, Christoph Hellwig wrote:
> > On Mon, May 04, 2020 at 06:54:53PM +0300, Konstantin Khlebnikov wrote:
> > > This is required to avoid waiting in lower layers.
> > >
> > > Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
> >
> > 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.
Once the fio changes land, can you add a simple fio based test
to xfstests?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH RFC 1/2] fs/iomap/direct-io: pass NOWAIT to bio flags
2020-05-04 15:54 [PATCH RFC 1/2] fs/iomap/direct-io: pass NOWAIT to bio flags Konstantin Khlebnikov
2020-05-04 15:54 ` [PATCH RFC 2/2] fs/direct-io: pass NOWAIT to also for read requests Konstantin Khlebnikov
2020-05-04 16:00 ` [PATCH RFC 1/2] fs/iomap/direct-io: pass NOWAIT to bio flags Christoph Hellwig
@ 2020-05-06 14:40 ` Christoph Hellwig
2 siblings, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2020-05-06 14:40 UTC (permalink / raw)
To: Konstantin Khlebnikov
Cc: linux-kernel, linux-block, Jens Axboe, Christoph Hellwig
On Mon, May 04, 2020 at 06:54:53PM +0300, Konstantin Khlebnikov wrote:
> This is required to avoid waiting in lower layers.
>
> Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Looks good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH RFC 2/2] fs/direct-io: pass NOWAIT to also for read requests
2020-05-04 15:54 ` [PATCH RFC 2/2] fs/direct-io: pass NOWAIT to also for read requests Konstantin Khlebnikov
@ 2020-05-06 14:40 ` Christoph Hellwig
0 siblings, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2020-05-06 14:40 UTC (permalink / raw)
To: Konstantin Khlebnikov
Cc: linux-kernel, linux-block, Jens Axboe, Christoph Hellwig
On Mon, May 04, 2020 at 06:54:57PM +0300, Konstantin Khlebnikov wrote:
> For some reason NOWAIT currently is passed only for writes.
>
> Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
> Fixes: 03a07c92a9ed ("block: return on congested block device")
Looks good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-05-06 14:40 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-04 15:54 [PATCH RFC 1/2] fs/iomap/direct-io: pass NOWAIT to bio flags Konstantin Khlebnikov
2020-05-04 15:54 ` [PATCH RFC 2/2] fs/direct-io: pass NOWAIT to also for read requests Konstantin Khlebnikov
2020-05-06 14:40 ` Christoph Hellwig
2020-05-04 16:00 ` [PATCH RFC 1/2] fs/iomap/direct-io: pass NOWAIT to bio flags Christoph Hellwig
2020-05-04 16:23 ` Konstantin Khlebnikov
2020-05-06 14:40 ` Christoph Hellwig
2020-05-06 14:40 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).