[LTP] [PATCH v2] syscalls/preadv203: Add basic RWF_NOWAIT test

Cyril Hrubis chrubis@suse.cz
Mon May 20 13:24:51 CEST 2019


Hi!
> > Ping, anybody has any comments or can be this be this merged?
> >
> 
> I have no objection to this test, but I have a question. Your claim is:
> "We are attempting to trigger the EAGAIN path for the RWF_NOWAIT flag."
> 
> Seems like you have gone to a great length of effort to achieve this.
> Wouldn't it be sufficient to do a single preadv2 after fsync+drop_caches in
> order to observe EAGAIN?

As far as I can tell the I/O to the device has to be saturated in order
to get EAGAIN at least for a subset of filesystems. If I just drop the
cache once then attempt to read with the NOWAIT flag it strangely works
only for ext2 for me.

So I guess that the manual page is a bit misleading and the NOWAIT flag
actually returns EAGAIN only if the calling thread would end up in a
queue or waiting for a lock, but I haven't looked into the kernel code
to make sure.

> There are several other ways to get EAGAIN, like DIO read/write when
> page cache *is* populated.

That is a good hint, I will have a look at that case as well.

> Question is, how much is the test trying to cover.

Well ideally we should excercise as much kernel code paths as
possible... :-)

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list