On 6/15/16, 10:56, "Christoph Hellwig" wrote: >On Wed, Jun 15, 2016 at 02:52:24PM +0000, Trond Myklebust wrote: >> >But XFS allows full parallelism for direct reads and writes as long >> >as there is no more pagecache to flush. But if you have pages in >> >the pagecache you need the exclusive lock to prevent against new >> >pagecache pages being added. >> >> Exactly. So does this. > >So let's avoid bloating the inode with another rw_semaphore, and make >everyones life easier by using the existing lock. As I said earlier, the problem with that is you end up artificially serialising buffered reads and buffered writes. • The reads only need a shared lock in order to protect the I/O mode from flipping to O_DIRECT (and relying on page locks to protect against buffered writes). • The writes need protection against O_DIRECT, they don’t need serialisation with other reads, but they do need to be serialised against other buffered writes. Disclaimer The information contained in this communication from the sender is confidential. It is intended solely for use by the recipient and others authorized to receive it. If you are not the recipient, you are hereby notified that any disclosure, copying, distribution or taking action in relation of the contents of this information is strictly prohibited and may be unlawful.