On Mon, Jan 11, 2021 at 05:12:09PM +0100, Christoph Hellwig wrote: > Hi all, > > this series avoids taking the iolock exclusively for direct I/O > writes that are not file system block size aligned, but also do > not require allocations or unwritten extent conversion. I wrote patches to do this yesterday, and ran it through testing overnight. I made a note that I need to do what your first two patches do, and this morning I was going to completely separate the DIO unaligned write path from block aligned write path because there's almost nothing shared between the two cases. I already commented that I don't like the approach brian suggested because of the requirement to cycle the ILOCK and duplicate all the checks that the IOMAP_NOWAIT case already does in the XFS DIO write submission code. i.e. I lift ithe trigger for IOMAP_NOWAIT to the iomap_dio_rw() caller so that we can use IOMAP_NOWAIT for unaligned IO, and only if that returns -EAGAIN do we run an exclusive IO. THis also means that we can run sub-block dio as AIO and under RWF_NOWAIT conditions without explicitly having to check for these things... Let me rework what I've done on the top of your first two patches and test it and I'll send it out later today for comparison. Cheers, Dave. -- Dave Chinner david@xxxxxxxxxxxxx