Details
-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
None
-
9223372036854775807
Description
Currently, readahead will not request an LDLM lock if it
encounters a region without one. This causes it to take
misses and can confuse the readahead state as well.
Not requesting locks for readahead is an artifact of the
idea that readahead is an optional optimization, but it's
almost as important as full reads/writes from userspace,
and we should request locks for it.
This will help cut down misses when starting to read a new
file, which is particularly helpful in tests, where total
I/O is small and the extra misses make it hard to predict
behavior.
The benefit can be seen in the test changes - miss counts
are reduced because stripe count no longer factors in, and
we can reenable async readahead because it no longer fails
due to this (leading to unpredictable numbers of misses).
I'm not against doing opportunistic read locking in the case where the client is properly doing readahead. If the client has a full-object lock on the current stripe, or al least the lock was expanded by one OST to cover an extent more than one stripe size, then it seems likely that it can get full-object locks for the other stripes as well (ie. there is no contention on the file, or at least not that region.
I do find it a bit odd that there wouldn't be an initial glimpse for all stripes to get locks for all stripes at open time? I've found that annoying in the write case, that the client glimpses all of the stripe locks in PR mode, only to have to cancel and refresh them in PW mode immediately. I have a prototype PW glimpse patch when files are opened for write that I should push for that.