diff mbox series

[RFC,1/2] fs/iomap/direct-io: pass NOWAIT to bio flags

Message ID 158860769311.32485.8003552176738816448.stgit@buzz (mailing list archive)
State New, archived
Headers show
Series [RFC,1/2] fs/iomap/direct-io: pass NOWAIT to bio flags | expand

Commit Message

Konstantin Khlebnikov May 4, 2020, 3:54 p.m. UTC
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(+)

Comments

Christoph Hellwig May 4, 2020, 4 p.m. UTC | #1
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?
Konstantin Khlebnikov May 4, 2020, 4:23 p.m. UTC | #2
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.
Christoph Hellwig May 6, 2020, 2:40 p.m. UTC | #3
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?
Christoph Hellwig May 6, 2020, 2:40 p.m. UTC | #4
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>
diff mbox series

Patch

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);