Re: [PATCH] xfs: Remove i_rwsem lock in buffered read
From: Dave Chinner
Date: Wed Jan 22 2025 - 18:36:04 EST
On Tue, Jan 21, 2025 at 10:08:10PM -0800, Christoph Hellwig wrote:
> On Sat, Jan 18, 2025 at 09:19:15AM +1100, Dave Chinner wrote:
> > And, quite frankly, the fact the bcachefs solution also covers AIO
> > DIO in flight (which i_rwsem based locking does not!) means it is a
> > more robust solution than trying to rely on racy i_dio_count hacks
> > and folio residency in the page cache...
>
> The original i_rwsem (still i_iolock then) scheme did that, but the
> core locking maintainers asked us to remove the non-owner unlocks,
> so I did that. It turns out later we got officially sanctioned
> non-owner unlocks, so we could have easily add this back. I did that
> 5 years ago, but reception was lukewarm:
>
> http://git.infradead.org/?p=users/hch/xfs.git;a=shortlog;h=refs/heads/i_rwsem-non_owner
I have no issues with the concept - I have always thought that
holding the IOLOCK to completion was how the IO locking should work
(like we do with the xfs_buf semaphore). The i_dio_count submission
barrier solution was a necessary hack because rwsems did not work
the way we needed to use them.
What I didn't like about the proposal above was the implementation
(i.e. the encoding of rwsem semantics in the iomap dio API and
implementation), but there was never any followup that addressed the
issues that were raised.....
-Dave.
--
Dave Chinner
david@xxxxxxxxxxxxx