* [PATCH] mm: Improve the comment in isolate_migratepages_block()
@ 2023-07-27 20:39 Matthew Wilcox
2023-07-27 21:10 ` David Hildenbrand
0 siblings, 1 reply; 2+ messages in thread
From: Matthew Wilcox @ 2023-07-27 20:39 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-mm, Kirill A. Shutemov
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;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] mm: Improve the comment in isolate_migratepages_block()
2023-07-27 20:39 [PATCH] mm: Improve the comment in isolate_migratepages_block() Matthew Wilcox
@ 2023-07-27 21:10 ` David Hildenbrand
0 siblings, 0 replies; 2+ messages in thread
From: David Hildenbrand @ 2023-07-27 21:10 UTC (permalink / raw)
To: Matthew Wilcox, Andrew Morton; +Cc: linux-mm, Kirill A. Shutemov
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-07-27 21:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-27 20:39 [PATCH] mm: Improve the comment in isolate_migratepages_block() Matthew Wilcox
2023-07-27 21:10 ` David Hildenbrand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox