From: Christoph Hellwig <hch@infradead.org>
To: "Kiryl Shutsemau (Meta)" <kas@kernel.org>
Cc: Andi Shyti <andi.shyti@kernel.org>,
Jani Nikula <jani.nikula@linux.intel.com>,
Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
Tvrtko Ursulin <tursulin@ursulin.net>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Andi Shyti <andi.shyti@linux.intel.com>,
David Hildenbrand <david@kernel.org>,
Hugh Dickins <hughd@google.com>,
Baolin Wang <baolin.wang@linux.alibaba.com>,
intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
kernel-team@meta.com
Subject: Re: [PATCH] drm/i915/gem: Skip writeback of shmem folios with extra references
Date: Tue, 24 Nov 2026 21:36:42 -0800 [thread overview]
Message-ID: <awZz6sq_4cjIgUcq@infradead.org> (raw)
In-Reply-To: <awBIB3vjr_o-gfCn@shutemov.name>
On Fri, Nov 20, 2026 at 01:17:31PM +0000, Kiryl Shutsemau (Meta) wrote:
> > > while ((folio = writeback_iter(mapping, &wbc, folio, &error))) {
> > > - if (folio_mapped(folio))
> > > + if (folio_mapped(folio) ||
> > > + folio_ref_count(folio) != 1 + folio_nr_pages(folio))
> >
> > I don't think we need this fix in the current tree. The i915
> > writeback iterator already skips the shmem folio in the case you
> > describe, so the new refcount check doesn't change the outcome.
>
> Oh. It took me a while to see why.
>
> __shmem_writeback() asks writeback_iter() for PAGECACHE_TAG_DIRTY
> folios, and shmem never sets that tag, its ->dirty_folio is
> noop_dirty_folio(). So the loop body never runs for any folio, and
> hasn't since 776a853a43c9 ("i915: Use writeback_iter()").
Heh. I'm surprised no one noticed..
> That makes me question the whole writeback thing. What's going on
> there, and what's the plan?
I (and others) have been asking forever to get drm out of micro-managing
tmpfs. I guess given that this code path hasn't worked for a year and
a half is a pretty good indicator that this instance should simply
go away.
next prev parent reply other threads:[~2026-11-25 5:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 13:42 Kiryl Shutsemau (Meta)
2026-11-19 17:43 ` Andi Shyti
2026-11-20 13:17 ` Kiryl Shutsemau (Meta)
2026-11-25 5:36 ` Christoph Hellwig [this message]
2026-11-25 9:38 ` Joonas Lahtinen
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=awZz6sq_4cjIgUcq@infradead.org \
--to=hch@infradead.org \
--cc=airlied@gmail.com \
--cc=andi.shyti@kernel.org \
--cc=andi.shyti@linux.intel.com \
--cc=baolin.wang@linux.alibaba.com \
--cc=david@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=hughd@google.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=kas@kernel.org \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rodrigo.vivi@intel.com \
--cc=simona@ffwll.ch \
--cc=tursulin@ursulin.net \
/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
all inboxes | Powered by JetHome®