* [PATCH 0/2] Folio fixes for 6.0
@ 2022-09-02 19:26 Matthew Wilcox (Oracle)
2022-09-02 19:26 ` [PATCH 1/2] mm: Fix VM_BUG_ON in __delete_from_swap_cache() Matthew Wilcox (Oracle)
2022-09-02 19:26 ` [PATCH 2/2] vmscan: Check folio_test_private(), not folio_get_private() Matthew Wilcox (Oracle)
0 siblings, 2 replies; 3+ messages in thread
From: Matthew Wilcox (Oracle) @ 2022-09-02 19:26 UTC (permalink / raw)
To: Andrew Morton, linux-mm; +Cc: Matthew Wilcox (Oracle)
Both patches being fixed were part of the 6.0-rc1 merge window, so
no backporting, nor cc: stable needed.
Matthew Wilcox (Oracle) (2):
mm: Fix VM_BUG_ON in __delete_from_swap_cache()
vmscan: Check folio_test_private(), not folio_get_private()
mm/swap_state.c | 2 +-
mm/vmscan.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
--
2.35.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] mm: Fix VM_BUG_ON in __delete_from_swap_cache()
2022-09-02 19:26 [PATCH 0/2] Folio fixes for 6.0 Matthew Wilcox (Oracle)
@ 2022-09-02 19:26 ` Matthew Wilcox (Oracle)
2022-09-02 19:26 ` [PATCH 2/2] vmscan: Check folio_test_private(), not folio_get_private() Matthew Wilcox (Oracle)
1 sibling, 0 replies; 3+ messages in thread
From: Matthew Wilcox (Oracle) @ 2022-09-02 19:26 UTC (permalink / raw)
To: Andrew Morton, linux-mm; +Cc: Matthew Wilcox (Oracle)
The recent folio conversion changed the VM_BUG_ON() to dump the folio
we're storing instead of the entry we retrieved. This was a mistake;
the entry we retrieved is the more interesting page to dump.
Fixes: ceff9d3354e9 ("mm/swap: convert __delete_from_swap_cache() to a folio")
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
mm/swap_state.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/swap_state.c b/mm/swap_state.c
index e166051566f4..41afa6d45b23 100644
--- a/mm/swap_state.c
+++ b/mm/swap_state.c
@@ -151,7 +151,7 @@ void __delete_from_swap_cache(struct folio *folio,
for (i = 0; i < nr; i++) {
void *entry = xas_store(&xas, shadow);
- VM_BUG_ON_FOLIO(entry != folio, folio);
+ VM_BUG_ON_PAGE(entry != folio, entry);
set_page_private(folio_page(folio, i), 0);
xas_next(&xas);
}
--
2.35.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 2/2] vmscan: Check folio_test_private(), not folio_get_private()
2022-09-02 19:26 [PATCH 0/2] Folio fixes for 6.0 Matthew Wilcox (Oracle)
2022-09-02 19:26 ` [PATCH 1/2] mm: Fix VM_BUG_ON in __delete_from_swap_cache() Matthew Wilcox (Oracle)
@ 2022-09-02 19:26 ` Matthew Wilcox (Oracle)
1 sibling, 0 replies; 3+ messages in thread
From: Matthew Wilcox (Oracle) @ 2022-09-02 19:26 UTC (permalink / raw)
To: Andrew Morton, linux-mm; +Cc: Matthew Wilcox (Oracle), Hugh Dickins
These two predicates are the same for file pages, but are not the
same for anonymous pages.
Reported-by: Hugh Dickins <hughd@google.com>
Fixes: 07f67a8dedc0 ("mm/vmscan: convert shrink_active_list() to use a folio")
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
mm/vmscan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index b2b1431352dc..382dbe97329f 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2550,8 +2550,8 @@ static void shrink_active_list(unsigned long nr_to_scan,
}
if (unlikely(buffer_heads_over_limit)) {
- if (folio_get_private(folio) && folio_trylock(folio)) {
- if (folio_get_private(folio))
+ if (folio_test_private(folio) && folio_trylock(folio)) {
+ if (folio_test_private(folio))
filemap_release_folio(folio, 0);
folio_unlock(folio);
}
--
2.35.1
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-09-02 19:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-02 19:26 [PATCH 0/2] Folio fixes for 6.0 Matthew Wilcox (Oracle)
2022-09-02 19:26 ` [PATCH 1/2] mm: Fix VM_BUG_ON in __delete_from_swap_cache() Matthew Wilcox (Oracle)
2022-09-02 19:26 ` [PATCH 2/2] vmscan: Check folio_test_private(), not folio_get_private() Matthew Wilcox (Oracle)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox