On 6/15/16, 10:56, "Christoph Hellwig" <hch@xxxxxxxxxxxxx> 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. ��.n��������+%������w��{.n�����{��w���jg��������ݢj����G�������j:+v���w�m������w�������h�����٥