linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Fan Ni <nifan.cxl@gmail.com>,
	linux-fsdevel@vger.kernel.org,  linux-mm@kvack.org,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 11/11] fs: Remove aops->writepage
Date: Fri, 02 May 2025 16:33:23 +0200	[thread overview]
Message-ID: <2238f487c71e07aa71ffd3b1b07e3deb72674d3b.camel@linux.intel.com> (raw)
In-Reply-To: <Z-wTw5p5r4yPGfFE@casper.infradead.org>

Hi, Matthew,

On Tue, 2025-04-01 at 17:26 +0100, Matthew Wilcox wrote:
> On Tue, Mar 18, 2025 at 09:10:38AM +0100, Thomas Hellström wrote:
> > On Mon, 2025-03-17 at 22:30 +0000, Matthew Wilcox wrote:
> > > This patch fixes the compilation problem.  But I don't understand
> > > why
> > > it's messing with the reclaim flag.  Thomas, can you explain?
> > 
> > Hi, Sorry for not responding earlier. The patch that uses
> > writepage()
> > here has been around for quite some time waiting for reviews / acks
> > so
> > I failed to notice that it's going away.
> 
> My turn to be sorry for dropping this conversation ...

Once again my turn. This disappeared in the mail flood. Sorry about
that.

> 
> > Anyway the reclaim flag clearing follows that of pageout() in
> > vmscan.c
> > which was also the case for the i915_gem_shmem.c usage in
> > __shmem_writeback(). My understanding was that if the writeback was
> > already completed at that point, the reclaim flag was no longer
> > desirable.
> 
> I think the question is really why you're setting it in the first
> place.
> Setting the reclaim flag indicates that you want the folio removed
> from
> the page cache as soon as possible. 

So when the shmem swapout has been called, My understanding was that
the page had been moved from the page cache to the swap cache and now
written out to disc and this is all part of reclaim.

When TTM reaches this part of the code, it's always called from a
shrinker with the aim of freeing up memory as soon as possible.

So if this is incorrect or unsuitable usage of the reclaim flag, we
should of course remove the manipulation of it. (IIRC I was also a bit
confused as to why it didn't seem to be protected by a lock in the
callsites I looked at) 

__shmem_writeback() in i915_gem_shmem.c and
pageout() in mm/vmscan.c

Thanks,
Thomas



>  Other changes in flight are about
> to make this more aggressive --  instead of waiting for the folio to
> reach the end of the writeout queue, it'll be removed upon I/O
> completion.
> 
> It doesn't seem to me that this is what you actually want for TTM,
> but perhaps I've misunderstood the intent of the code.


  reply	other threads:[~2025-05-02 14:33 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-07 13:54 [PATCH 00/11] Remove aops->writepage Matthew Wilcox (Oracle)
2025-03-07 13:54 ` [PATCH 01/11] f2fs: Remove check for ->writepage Matthew Wilcox (Oracle)
2025-03-07 13:54 ` [PATCH 02/11] f2fs: Remove f2fs_write_data_page() Matthew Wilcox (Oracle)
2025-03-07 13:54 ` [PATCH 03/11] f2fs: Remove f2fs_write_meta_page() Matthew Wilcox (Oracle)
2025-03-07 13:54 ` [PATCH 04/11] f2fs: Remove f2fs_write_node_page() Matthew Wilcox (Oracle)
2025-03-07 13:54 ` [PATCH 05/11] vboxsf: Convert to writepages Matthew Wilcox (Oracle)
2025-03-07 13:54 ` [PATCH 06/11] migrate: Remove call to ->writepage Matthew Wilcox (Oracle)
2025-03-27 15:04   ` Zi Yan
2025-03-27 16:52     ` Matthew Wilcox
2025-03-27 17:22       ` Zi Yan
2025-04-01 13:32         ` David Hildenbrand
2025-03-07 13:54 ` [PATCH 07/11] writeback: Remove writeback_use_writepage() Matthew Wilcox (Oracle)
2025-03-07 13:54 ` [PATCH 08/11] shmem: Add shmem_writeout() Matthew Wilcox (Oracle)
2025-03-08  5:31   ` Baolin Wang
2025-03-07 13:54 ` [PATCH 09/11] i915: Use writeback_iter() Matthew Wilcox (Oracle)
2025-03-07 13:54 ` [PATCH 10/11] mm: Remove swap_writepage() and shmem_writepage() Matthew Wilcox (Oracle)
2025-03-08  5:34   ` Baolin Wang
2025-03-07 13:54 ` [PATCH 11/11] fs: Remove aops->writepage Matthew Wilcox (Oracle)
2025-03-17  1:08   ` Fan Ni
2025-03-17  3:22     ` Matthew Wilcox
2025-03-17 22:30       ` Matthew Wilcox
2025-03-18  8:10         ` Thomas Hellström
2025-04-01 16:26           ` Matthew Wilcox
2025-05-02 14:33             ` Thomas Hellström [this message]
2025-03-28  9:40 ` [PATCH 00/11] " Christian Brauner

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=2238f487c71e07aa71ffd3b1b07e3deb72674d3b.camel@linux.intel.com \
    --to=thomas.hellstrom@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nifan.cxl@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).