From: Christoph Hellwig <hch@infradead.org>
To: Tal Zussman <tz2294@columbia.edu>
Cc: Jens Axboe <axboe@kernel.dk>,
"Matthew Wilcox (Oracle)" <willy@infradead.org>,
Christian Brauner <brauner@kernel.org>,
"Darrick J. Wong" <djwong@kernel.org>,
Carlos Maiolino <cem@kernel.org>,
Alexander Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>,
Christoph Hellwig <hch@infradead.org>,
Gao Xiang <xiang@kernel.org>, Chao Yu <chao@kernel.org>,
Yue Hu <zbestahu@gmail.com>,
Jeffle Xu <jefflexu@linux.alibaba.com>,
Sandeep Dhavale <dhavale@google.com>,
Hongbo Li <lihongbo22@huawei.com>,
Chunhai Guo <guochunhai@vivo.com>, Dave Chinner <dgc@kernel.org>,
Bart Van Assche <bvanassche@acm.org>,
Hillf Danton <hdanton@sina.com>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-mm@kvack.org, linux-erofs@lists.ozlabs.org,
Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH v7 3/5] iomap: use BIO_COMPLETE_IN_TASK for dropbehind writeback
Date: Thu, 30 Jul 2026 01:13:33 -0700 [thread overview]
Message-ID: <amsHrVCJnuXzeGG1@infradead.org> (raw)
In-Reply-To: <20260730-blk-dontcache-v7-3-3e8e6850068d@columbia.edu>
On Thu, Jul 30, 2026 at 02:57:53AM -0400, Tal Zussman wrote:
> Set BIO_COMPLETE_IN_TASK on iomap writeback bios when a dropbehind folio
> is added. This ensures that bi_end_io runs in task context, where
> folio_end_dropbehind() can safely invalidate folios.
>
> With the bio layer now handling task-context deferral generically,
> IOMAP_IOEND_DONTCACHE is no longer needed, as XFS no longer needs to
> route DONTCACHE ioends through its completion workqueue. Remove the flag
> and its NOMERGE entry.
>
> Without the NOMERGE, regular I/Os that get merged with a dropbehind
> folio will also have their completion deferred to task context.
>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Tal Zussman <tz2294@columbia.edu>
This seems to be missing the bug fix you identified for the double
deferral?
I although thought a bit how that could be done cleaner, see below:
> ioend_flags |= IOMAP_IOEND_SHARED;
> - if (folio_test_dropbehind(folio))
> - ioend_flags |= IOMAP_IOEND_DONTCACHE;
I'd keep this flag.
> if (pos == wpc->iomap.offset && (wpc->iomap.flags & IOMAP_F_BOUNDARY))
> ioend_flags |= IOMAP_IOEND_BOUNDARY;
>
> @@ -256,6 +254,9 @@ ssize_t iomap_add_to_ioend(struct iomap_writepage_ctx *wpc, struct folio *folio,
> if (!bio_add_folio(&ioend->io_bio, folio, map_len, poff))
> goto new_ioend;
>
> + if (folio_test_dropbehind(folio))
> + bio_set_flag(&ioend->io_bio, BIO_COMPLETE_IN_TASK);
And move setting the flag to iomap_ioend_writeback_submit, and only
for the case where no io_bio.bi_end_io is already assigned.
next prev parent reply other threads:[~2026-07-30 8:13 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-30 6:57 [PATCH v7 0/5] block: enable RWF_DONTCACHE for block devices Tal Zussman
2026-07-30 6:57 ` [PATCH v7 1/5] block: introduce bio_in_atomic() Tal Zussman
2026-07-30 8:06 ` Christoph Hellwig
2026-07-30 9:02 ` Jan Kara
2026-07-30 6:57 ` [PATCH v7 2/5] block: add task-context bio completion infrastructure Tal Zussman
2026-07-30 8:09 ` Christoph Hellwig
2026-07-30 9:29 ` Jan Kara
2026-07-30 6:57 ` [PATCH v7 3/5] iomap: use BIO_COMPLETE_IN_TASK for dropbehind writeback Tal Zussman
2026-07-30 8:13 ` Christoph Hellwig [this message]
2026-07-30 6:57 ` [PATCH v7 4/5] buffer: set " Tal Zussman
2026-07-30 9:31 ` Jan Kara
2026-07-30 6:57 ` [PATCH v7 5/5] block: enable RWF_DONTCACHE for block devices Tal Zussman
2026-07-30 9:33 ` Jan Kara
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=amsHrVCJnuXzeGG1@infradead.org \
--to=hch@infradead.org \
--cc=axboe@kernel.dk \
--cc=bigeasy@linutronix.de \
--cc=brauner@kernel.org \
--cc=bvanassche@acm.org \
--cc=cem@kernel.org \
--cc=chao@kernel.org \
--cc=dgc@kernel.org \
--cc=dhavale@google.com \
--cc=djwong@kernel.org \
--cc=guochunhai@vivo.com \
--cc=hch@lst.de \
--cc=hdanton@sina.com \
--cc=jack@suse.cz \
--cc=jefflexu@linux.alibaba.com \
--cc=lihongbo22@huawei.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-erofs@lists.ozlabs.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-xfs@vger.kernel.org \
--cc=tz2294@columbia.edu \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.org \
--cc=xiang@kernel.org \
--cc=zbestahu@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox