From: David Hildenbrand <david@redhat.com>
To: Matthew Wilcox <willy@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, "Kirill A. Shutemov" <kirill@shutemov.name>
Subject: Re: [PATCH] mm: Improve the comment in isolate_migratepages_block()
Date: Thu, 27 Jul 2023 23:10:55 +0200 [thread overview]
Message-ID: <57c10b7b-c577-d92d-cdd8-37b535c63931@redhat.com> (raw)
In-Reply-To: <ZMLWEB4m3zvX6SBN@casper.infradead.org>
On 27.07.23 22:39, Matthew Wilcox wrote:
> A recent patch shows that not everybody understands that "stabilise the
> mapping" really means "prevent the mapping from being freed", so change
> the wording to hopefully make that more clear.
>
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
>
> diff --git a/mm/compaction.c b/mm/compaction.c
> index 9641e2131901..9be2c3504ff2 100644
> --- a/mm/compaction.c
> +++ b/mm/compaction.c
> @@ -1095,13 +1095,13 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn,
> bool migrate_dirty;
>
> /*
> - * Only pages without mappings or that have a
> - * ->migrate_folio callback are possible to migrate
> - * without blocking. However, we can be racing with
> - * truncation so it's necessary to lock the page
> - * to stabilise the mapping as truncation holds
> - * the page lock until after the page is removed
> - * from the page cache.
> + * Only folios without mappings or that have
> + * a ->migrate_folio callback are possible to
> + * migrate without blocking. However, we may
> + * be racing with truncation, which can free
> + * the mapping. Truncation holds the folio lock
> + * until after the folio is removed from the page
> + * cache so holding it ourselves is sufficient.
> */
> if (!folio_trylock(folio))
> goto isolate_fail_put;
>
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Cheers,
David / dhildenb
prev parent reply other threads:[~2023-07-27 21:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-27 20:39 Matthew Wilcox
2023-07-27 21:10 ` David Hildenbrand [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=57c10b7b-c577-d92d-cdd8-37b535c63931@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=kirill@shutemov.name \
--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