linux-nilfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Ryusuke Konishi <konishi.ryusuke@gmail.com>,
	Hugh Dickins <hughd@google.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Yosry Ahmed <yosry.ahmed@linux.dev>,
	Nhat Pham <nphamcs@gmail.com>,
	Chengming Zhou <chengming.zhou@linux.dev>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	linux-nilfs@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 2/7] mm: stop passing a writeback_control structure to shmem_writeout
Date: Thu, 8 May 2025 14:25:00 +0100	[thread overview]
Message-ID: <aBywrEMTCKfT9BFo@casper.infradead.org> (raw)
In-Reply-To: <20250508054938.15894-3-hch@lst.de>

On Thu, May 08, 2025 at 07:47:44AM +0200, Christoph Hellwig wrote:
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_shmem.c
> @@ -318,7 +318,7 @@ void __shmem_writeback(size_t size, struct address_space *mapping)
>  		if (folio_mapped(folio))
>  			folio_redirty_for_writepage(&wbc, folio);
>  		else
> -			error = shmem_writeout(folio, &wbc);
> +			error = shmem_writeout(folio, NULL, NULL);
>  	}
>  }

This got me to look at why we need to keep wbc in __shmem_writeback().
We only have it because folio_redirty_for_writepage() needs it.  And
folio_redirty_for_writepage() only needs it because it updates
pages_skipped.

I'm not quite sure if we can simply call filemap_dirty_folio() here
or whether mapping_can_writeback() is true for shmem and we need to
do all the other things -- in which case we could just change that one
line to

	if (wbc)
		wbc->pages_skipped += nr;

and then pass NULL to folio_redirty_for_writepage() and delete the
wbc on the stack.


  parent reply	other threads:[~2025-05-08 13:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-08  5:47 stop passing a writeback_control to swap/shmem writeout Christoph Hellwig
2025-05-08  5:47 ` [PATCH 1/7] mm: split out a writeout helper from pageout Christoph Hellwig
2025-05-08  5:47 ` [PATCH 2/7] mm: stop passing a writeback_control structure to shmem_writeout Christoph Hellwig
2025-05-08 13:03   ` kernel test robot
2025-05-08 13:25   ` Matthew Wilcox [this message]
2025-05-08 14:03     ` Christoph Hellwig
2025-05-08  5:47 ` [PATCH 3/7] mm: tidy up swap_writeout Christoph Hellwig
2025-05-08  5:47 ` [PATCH 4/7] mm: stop passing a writeback_control structure to __swap_writepage Christoph Hellwig
2025-05-08  5:47 ` [PATCH 5/7] mm: stop passing a writeback_control structure to swap_writeout Christoph Hellwig
2025-05-08 11:38   ` kernel test robot
2025-05-08  5:47 ` [PATCH 6/7] nilfs2: remove wbc->for_reclaim handling Christoph Hellwig
2025-05-08 16:16   ` Ryusuke Konishi
2025-05-16  4:55     ` Christoph Hellwig
2025-05-16  6:08       ` Ryusuke Konishi
2025-05-08  5:47 ` [PATCH 7/7] mm: remove the for_reclaim field from struct writeback_control Christoph Hellwig

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=aBywrEMTCKfT9BFo@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=chengming.zhou@linux.dev \
    --cc=hannes@cmpxchg.org \
    --cc=hch@lst.de \
    --cc=hughd@google.com \
    --cc=konishi.ryusuke@gmail.com \
    --cc=linux-mm@kvack.org \
    --cc=linux-nilfs@vger.kernel.org \
    --cc=nphamcs@gmail.com \
    --cc=yosry.ahmed@linux.dev \
    /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).