Re: [PATCH v2 1/3] mm: kick writeback flusher instead of inline flush for IOCB_DONTCACHE

Jeff Layton
2026-04-10T11:05:22Z

On Fri, 2026-04-10 at 12:41 +0200, Jan Kara wrote:
> On Thu 09-04-26 07:21:22, Christoph Hellwig wrote:
> > On Thu, Apr 09, 2026 at 09:21:36AM +0200, Jan Kara wrote:
> > > > So I think you'll want a new WB_start_dontcache bit, a new
> > > > get_nr_dontcache_pages() helper on a new node counter, etc.
> > >
> > > But I'm not sure how you imagine this would work without restricting
> > > writeback to particular inodes. Maybe we could mark inodes which have
> > > folios with dropbehind set and make flush worker only write such inodes?
> >
> > I'd only expedite writing by the number of pending dontcache folios.
> > It would still write the least recently dirtied inodes.
>
> So that may result in dontcache folios staying cached for quite some time
> if DONTCACHE and normal writes are mixed. But I agree over longer time it
> might just level out so maybe that's fine.
>

I think that's probably OK. In my interpretation, DONTCACHE on write
just means "don't cache this data beyond what's needed for writeback".
It doesn't provide any guarantees about when the writeback will be
done.
--
Jeff Layton <jlayton@kernel.org>