[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8734piacp7.fsf@gmail.com>
Date: Wed, 12 Jun 2024 12:07:40 +0530
From: Ritesh Harjani (IBM) <ritesh.list@...il.com>
To: "Darrick J. Wong" <djwong@...nel.org>
Cc: linux-ext4@...r.kernel.org, linux-xfs@...r.kernel.org, linux-fsdevel@...r.kernel.org, Dave Chinner <david@...morbit.com>, Matthew Wilcox <willy@...radead.org>, Christoph Hellwig <hch@...radead.org>, Christian Brauner <brauner@...nel.org>, Ojaswin Mujoo <ojaswin@...ux.ibm.com>, Jan Kara <jack@...e.cz>, Luis Chamberlain <mcgrof@...nel.org>
Subject: Re: [PATCH] Documentation: document the design of iomap and how to port
"Darrick J. Wong" <djwong@...nel.org> writes:
> On Tue, Jun 11, 2024 at 04:15:02PM +0530, Ritesh Harjani wrote:
>>
>> Hi Darrick,
>>
>> Resuming my review from where I left off yesterday.
>
<snip>
>> > +Writes
>> > +~~~~~~
>> > +
>> > +The ``iomap_file_buffered_write`` function writes an ``iocb`` to the
>> > +pagecache.
>> > +``IOMAP_WRITE`` or ``IOMAP_WRITE`` | ``IOMAP_NOWAIT`` will be passed as
>> > +the ``flags`` argument to ``->iomap_begin``.
>> > +Callers commonly take ``i_rwsem`` in either shared or exclusive mode.
>>
>> shared(e.g. aligned overwrites)
>
Ok, I see we were in buffered I/O section (Sorry, I misunderstood
thinking this was for direct-io)
> That's a matter of debate -- xfs locks out concurrent reads by taking
> i_rwsem in exclusive mode, whereas (I think?) ext4 and most other
> filesystems take it in shared mode and synchronizes readers and writers
> with folio locks.
Ext4 too takes inode lock in exclusive mode in case of
buffered-write. It's the DIO writes/overwrites in ext4 which has special
casing for shared/exclusive mode locking.
But ext4 buffered-read does not take any inode lock (it uses
generic_file_read_iter()). So the synchronization must happen via folio
lock w.r.t buffered-writes.
However, I am not sure if we have any filesystem taking VFS inode lock in
shared more for buffered-writes.
BTW -
I really like all of the other updates that you made w.r.t the review
comments. All of those looks more clear to me. (so not commenting on them
individually).
Thanks!
-ritesh
Powered by blists - more mailing lists