From: "Darrick J. Wong" <djwong@kernel.org>
To: Ritesh Harjani <ritesh.list@gmail.com>
Cc: linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org,
linux-fsdevel@vger.kernel.org, Dave Chinner <david@fromorbit.com>,
Matthew Wilcox <willy@infradead.org>,
Christoph Hellwig <hch@infradead.org>,
Christian Brauner <brauner@kernel.org>,
Ojaswin Mujoo <ojaswin@linux.ibm.com>, Jan Kara <jack@suse.cz>,
Luis Chamberlain <mcgrof@kernel.org>
Subject: Re: [PATCH] Documentation: document the design of iomap and how to port
Date: Wed, 12 Jun 2024 15:15:29 -0700 [thread overview]
Message-ID: <20240612221529.GM2764752@frogsfrogsfrogs> (raw)
In-Reply-To: <8734piacp7.fsf@gmail.com>
On Wed, Jun 12, 2024 at 12:07:40PM +0530, Ritesh Harjani wrote:
>
> "Darrick J. Wong" <djwong@kernel.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)
Aha. I'll change these headings to "Buffered Readahead and Reads" and
"Buffered Writes".
> > 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.
In theory you could if no other metadata needed updating, such as a dumb
filesystem with fixed size files where timestamps don't matter.
> 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!
No, thank /you/ and everyone else for reading all the way through it.
I'll finish cleaning things up and put out a v2.
--D
> -ritesh
>
next prev parent reply other threads:[~2024-06-12 22:15 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-08 0:17 [PATCH] Documentation: document the design of iomap and how to port Darrick J. Wong
2024-06-09 6:36 ` Christoph Hellwig
2024-06-09 15:55 ` Darrick J. Wong
2024-06-10 14:18 ` Jan Kara
2024-06-10 21:59 ` Darrick J. Wong
2024-06-10 22:25 ` Jan Kara
2024-06-11 1:32 ` Dave Chinner
2024-06-12 0:37 ` Darrick J. Wong
2024-06-11 16:12 ` Christoph Hellwig
2024-06-11 21:43 ` Darrick J. Wong
2024-06-10 8:57 ` Ritesh Harjani
2024-06-10 23:11 ` Darrick J. Wong
2024-06-11 6:43 ` Ritesh Harjani
2024-06-11 21:50 ` Darrick J. Wong
2024-06-12 6:55 ` Ritesh Harjani
2024-06-11 10:45 ` Ritesh Harjani
2024-06-11 23:47 ` Darrick J. Wong
2024-06-12 6:37 ` Ritesh Harjani
2024-06-12 22:15 ` Darrick J. Wong [this message]
2024-06-12 13:24 ` Ritesh Harjani
2024-06-13 17:58 ` Darrick J. Wong
2024-06-14 15:01 ` Ritesh Harjani
2024-06-14 20:41 ` Darrick J. Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240612221529.GM2764752@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=brauner@kernel.org \
--cc=david@fromorbit.com \
--cc=hch@infradead.org \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=ojaswin@linux.ibm.com \
--cc=ritesh.list@gmail.com \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.