Skip to contentSkip to conversation

mm-unstable-multi-gen-lru-fix-can_swap-in-lru_gen_look_around.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Aug 21, 2023

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: Multi-gen LRU: fix can_swap in lru_gen_look_around()
has been removed from the -mm tree. Its filename was
mm-unstable-multi-gen-lru-fix-can_swap-in-lru_gen_look_around.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Kalesh Singh <[email protected]>
Subject: Multi-gen LRU: fix can_swap in lru_gen_look_around()
Date: Tue, 1 Aug 2023 19:56:04 -0700

walk->can_swap might be invalid since it's not guaranteed to be initialized for the particular lruvec. Instead deduce it from the folio type (anon/file).

Fixes 018ee47f1489 ("mm: multi-gen LRU: exploit locality in rmap")
Cc Yu Zhao <[email protected]>
Cc Aneesh Kumar K V <[email protected]>
Cc Barry Song <[email protected]>
Cc Brian Geffon <[email protected]>
Cc Jan Alexander Steffens (heftig) <[email protected]>
Cc Lecopzer Chen <[email protected]>
Cc Matthias Brugger <[email protected]>
Cc Oleksandr Natalenko <[email protected]>
Cc Qi Zheng <[email protected]>
Cc Steven Barrett <[email protected]>
Cc Suleiman Souhlal <[email protected]>
Cc Suren Baghdasaryan <[email protected]>

---

 mm/vmscan.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
mm/vmscan.c renamed from mm/vmscan.c~mm-unstable-multi-gen-lru-fix-can_swap-in-lru_gen_look_around +2 -1
@@ -4656,6 +4656,7 @@ void lru_gen_look_around(struct page_vma
 	pte_t *pte = pvmw->pte;
 	unsigned long addr = pvmw->address;
 	struct folio *folio = pfn_folio(pvmw->pfn);
+	bool can_swap = !folio_is_file_lru(folio);
 	struct mem_cgroup *memcg = folio_memcg(folio);
 	struct pglist_data *pgdat = folio_pgdat(folio);
 	struct lruvec *lruvec = mem_cgroup_lruvec(memcg, pgdat);
@@ -4704,7 +4705,7 @@ void lru_gen_look_around(struct page_vma
 		if (!pte_young(ptent))
 			continue;
 
-		folio = get_pfn_folio(pfn, memcg, pgdat, !walk || walk->can_swap);
+		folio = get_pfn_folio(pfn, memcg, pgdat, can_swap);
 		if (!folio)
 			continue;
 

_

Patches currently in -mm which might be from [email protected] are