From: "Darrick J. Wong" <djwong@kernel.org>
To: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] mm: Assert the folio is locked in folio_start_writeback()
Date: Wed, 26 Feb 2025 08:21:48 -0800 [thread overview]
Message-ID: <20250226162148.GA6225@frogsfrogsfrogs> (raw)
In-Reply-To: <20250226153614.3774896-1-willy@infradead.org>
On Wed, Feb 26, 2025 at 03:36:12PM +0000, Matthew Wilcox (Oracle) wrote:
> The folio must be locked when we start writeback in order to
> prevent writeback from being started twice on the same folio.
> I don't expect this to catch any problems, but it should be
> good documentation.
>
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
LGTM
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
--D
> ---
> mm/page-writeback.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/mm/page-writeback.c b/mm/page-writeback.c
> index eb55ece39c56..8b325aa525eb 100644
> --- a/mm/page-writeback.c
> +++ b/mm/page-writeback.c
> @@ -3109,6 +3109,7 @@ void __folio_start_writeback(struct folio *folio, bool keep_write)
> int access_ret;
>
> VM_BUG_ON_FOLIO(folio_test_writeback(folio), folio);
> + VM_BUG_ON_FOLIO(!folio_test_locked(folio), folio);
>
> if (mapping && mapping_use_writeback_tags(mapping)) {
> XA_STATE(xas, &mapping->i_pages, folio_index(folio));
> --
> 2.47.2
>
>
prev parent reply other threads:[~2025-02-26 16:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-26 15:36 Matthew Wilcox (Oracle)
2025-02-26 16:21 ` Darrick J. Wong [this message]
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=20250226162148.GA6225@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--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