From nobody Sat Jul 25 05:28:45 2026 Received: from out30-118.freemail.mail.aliyun.com (out30-118.freemail.mail.aliyun.com [115.124.30.118]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4588B3EB0EB for ; Fri, 17 Jul 2026 10:05:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.118 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784282763; cv=none; b=T22L9JjRALSUjr7UqjcKhziWBGVd1PZ4Cp4A2RqGAjRxghg8I5NTFhAYAezsbudFC813eK6EmMXfBC/H6f0KCzVKV4hrGAYZBRwEoUwKZTOHQ1xQotPCdaJWiKcpNfb3/8c8moAe6XFgKGrfJdvxc46XMIkhlTRm/+xv9oWZxko= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784282763; c=relaxed/simple; bh=VeevQZR2u1ZhNcfm0g2F5lFrF3k3eN5Qn3mCRLYDfbk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QNMI1icluCUgZfGChUyfhaSA7ZVitJnzqtPeMajt6wUtQuUeNnlTZYxD3yCzzlEFVhE00g735ckHck7KuU+l+CLripi8PLUMl10erCr9AQCRToGLWlpbOXiu3KtnpdSJD/I9RBWjtJ2xEeyKXyx2zVUJ/c0+80BTdEpy7y+2C64= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=pcR20/1p; arc=none smtp.client-ip=115.124.30.118 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="pcR20/1p" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1784282757; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=tAYC/vuatV8lqZoWTXT6LbSsANdL41Xd2xVEBPcOqvM=; b=pcR20/1pl+eFI+5QxGi3uKAbfLy/8am1OWRmCPoE8ojWc3jHSqPOskJbhmnFlwHLsVC7OnXCW1CWneT+gNZjLfbtZQyE0nsGePmTh/3KlHCCYS0ybnguv9hsKYRn++NwMg3iggVUsXozHCa6YN2u50Uo5gE+N8FwI5xD2pRVH1g= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R141e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam011083073210;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=21;SR=0;TI=SMTPD_---0X7Gx5cg_1784282754; Received: from localhost(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0X7Gx5cg_1784282754 cluster:ay36) by smtp.aliyun-inc.com; Fri, 17 Jul 2026 18:05:55 +0800 From: Baolin Wang To: akpm@linux-foundation.org, david@kernel.org, ljs@kernel.org, hannes@cmpxchg.org Cc: riel@surriel.com, liam@infradead.org, vbabka@kernel.org, harry@kernel.org, jannh@google.com, lance.yang@linux.dev, kasong@tencent.com, qi.zheng@linux.dev, shakeel.butt@linux.dev, baohua@kernel.org, axelrasmussen@google.com, yuanchu@google.com, weixugc@google.com, mhocko@kernel.org, baolin.wang@linux.alibaba.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/2] mm: vmscan: convert folio_referenced() to use vma_flags_t Date: Fri, 17 Jul 2026 18:05:33 +0800 Message-ID: X-Mailer: git-send-email 2.43.5 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Replace use of the legacy vm_flags_t flags with vma_flags_t values for folio_referenced() and related logic. This is also a preparation for the following changes. No functional changes. Signed-off-by: Baolin Wang Acked-by: David Hildenbrand (Arm) Acked-by: Johannes Weiner Reviewed-by: Axel Rasmussen Reviewed-by: Barry Song Reviewed-by: Kairui Song --- include/linux/rmap.h | 7 +++---- mm/rmap.c | 19 +++++++++++-------- mm/vmscan.c | 14 +++++++------- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 8dc0871e5f00..e090aa09825d 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h @@ -843,7 +843,7 @@ static inline int folio_try_share_anon_rmap_pmd(struct = folio *folio, * Called from mm/vmscan.c to handle paging out */ int folio_referenced(struct folio *, int is_locked, - struct mem_cgroup *memcg, vm_flags_t *vm_flags); + struct mem_cgroup *memcg, vma_flags_t *vma_flags); =20 void try_to_migrate(struct folio *folio, enum ttu_flags flags); void try_to_unmap(struct folio *, enum ttu_flags flags); @@ -975,10 +975,9 @@ struct anon_vma *folio_lock_anon_vma_read(const struct= folio *folio, #define anon_vma_prepare(vma) (0) =20 static inline int folio_referenced(struct folio *folio, int is_locked, - struct mem_cgroup *memcg, - vm_flags_t *vm_flags) + struct mem_cgroup *memcg, vma_flags_t *vma_flags) { - *vm_flags =3D 0; + vma_flags_clear_all(vma_flags); return 0; } =20 diff --git a/mm/rmap.c b/mm/rmap.c index e854679553b9..4085540b6a25 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -907,7 +907,7 @@ pmd_t *mm_find_pmd(struct mm_struct *mm, unsigned long = address) struct folio_referenced_arg { int mapcount; int referenced; - vm_flags_t vm_flags; + vma_flags_t vma_flags; struct mem_cgroup *memcg; }; =20 @@ -926,7 +926,7 @@ static bool folio_referenced_one(struct folio *folio, address =3D pvmw.address; nr =3D 1; =20 - if (vma->vm_flags & VM_LOCKED) { + if (vma_test(vma, VMA_LOCKED_BIT)) { ptes++; pra->mapcount--; =20 @@ -947,7 +947,7 @@ static bool folio_referenced_one(struct folio *folio, /* Restore the mlock which got missed */ mlock_vma_folio(folio, vma); page_vma_mapped_walk_done(&pvmw); - pra->vm_flags |=3D VM_LOCKED; + vma_flags_set(&pra->vma_flags, VMA_LOCKED_BIT); return false; /* To break the loop */ } =20 @@ -1015,8 +1015,11 @@ static bool folio_referenced_one(struct folio *folio, referenced++; =20 if (referenced) { + vma_flags_t vma_flags =3D vma->flags; + pra->referenced++; - pra->vm_flags |=3D vma->vm_flags & ~VM_LOCKED; + vma_flags_clear(&vma_flags, VMA_LOCKED_BIT); + vma_flags_set_mask(&pra->vma_flags, vma_flags); } =20 if (!pra->mapcount) @@ -1054,7 +1057,7 @@ static bool invalid_folio_referenced_vma(struct vm_ar= ea_struct *vma, void *arg) * @folio: The folio to test. * @is_locked: Caller holds lock on the folio. * @memcg: target memory cgroup - * @vm_flags: A combination of all the vma->vm_flags which referenced the = folio. + * @vma_flags: A combination of all the vma->flags which referenced the fo= lio. * * Quick test_and_clear_referenced for all mappings of a folio, * @@ -1062,7 +1065,7 @@ static bool invalid_folio_referenced_vma(struct vm_ar= ea_struct *vma, void *arg) * the function bailed out due to rmap lock contention. */ int folio_referenced(struct folio *folio, int is_locked, - struct mem_cgroup *memcg, vm_flags_t *vm_flags) + struct mem_cgroup *memcg, vma_flags_t *vma_flags) { bool we_locked =3D false; struct folio_referenced_arg pra =3D { @@ -1078,7 +1081,7 @@ int folio_referenced(struct folio *folio, int is_lock= ed, }; =20 VM_WARN_ON_ONCE_FOLIO(folio_is_zone_device(folio), folio); - *vm_flags =3D 0; + vma_flags_clear_all(vma_flags); if (!pra.mapcount) return 0; =20 @@ -1092,7 +1095,7 @@ int folio_referenced(struct folio *folio, int is_lock= ed, } =20 rmap_walk(folio, &rwc); - *vm_flags =3D pra.vm_flags; + vma_flags_set_mask(vma_flags, pra.vma_flags); =20 if (we_locked) folio_unlock(folio); diff --git a/mm/vmscan.c b/mm/vmscan.c index 986dde8e7429..de62899c108d 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -861,16 +861,16 @@ static enum folio_references folio_check_references(s= truct folio *folio, struct scan_control *sc) { int referenced_ptes, referenced_folio; - vm_flags_t vm_flags; + vma_flags_t vma_flags; =20 referenced_ptes =3D folio_referenced(folio, 1, sc->target_mem_cgroup, - &vm_flags); + &vma_flags); =20 /* * The supposedly reclaimable folio was found to be in a VM_LOCKED vma. * Let the folio, now marked Mlocked, be moved to the unevictable list. */ - if (vm_flags & VM_LOCKED) + if (vma_flags_test(&vma_flags, VMA_LOCKED_BIT)) return FOLIOREF_ACTIVATE; =20 /* @@ -914,7 +914,7 @@ static enum folio_references folio_check_references(str= uct folio *folio, /* * Activate file-backed executable folios after first usage. */ - if ((vm_flags & VM_EXEC) && folio_is_file_lru(folio)) + if (vma_flags_test(&vma_flags, VMA_EXEC_BIT) && folio_is_file_lru(folio)) return FOLIOREF_ACTIVATE; =20 return FOLIOREF_KEEP; @@ -2065,7 +2065,7 @@ static void shrink_active_list(unsigned long nr_to_sc= an, { unsigned long nr_taken; unsigned long nr_scanned; - vm_flags_t vm_flags; + vma_flags_t vma_flags; LIST_HEAD(l_hold); /* The folios which were snipped off */ LIST_HEAD(l_active); LIST_HEAD(l_inactive); @@ -2109,7 +2109,7 @@ static void shrink_active_list(unsigned long nr_to_sc= an, =20 /* Referenced or rmap lock contention: rotate */ if (folio_referenced(folio, 0, sc->target_mem_cgroup, - &vm_flags) !=3D 0) { + &vma_flags) !=3D 0) { /* * Identify referenced, file-backed active folios and * give them one more trip around the active list. So @@ -2119,7 +2119,7 @@ static void shrink_active_list(unsigned long nr_to_sc= an, * IO, plus JVM can create lots of anon VM_EXEC folios, * so we ignore them here. */ - if ((vm_flags & VM_EXEC) && folio_is_file_lru(folio)) { + if (vma_flags_test(&vma_flags, VMA_EXEC_BIT) && folio_is_file_lru(folio= )) { nr_rotated +=3D folio_nr_pages(folio); list_add(&folio->lru, &l_active); continue; --=20 2.47.3 From nobody Sat Jul 25 05:28:45 2026 Received: from out30-118.freemail.mail.aliyun.com (out30-118.freemail.mail.aliyun.com [115.124.30.118]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1398A3EB108 for ; Fri, 17 Jul 2026 10:05:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.118 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784282764; cv=none; b=s1DhbpZ33eDOWHRHVe5Do+vIB2yeu8Vlje5WRwg0hKkYtwdSxi5X3PezHM9NcSxIuU4U2O98okm3IGA868Vd3HqlSFdcI87XkR3x+p1yM8oqZKvvcbs3ooNcDrZWbV6SuA1YMq7MdxRQnDBttpdufw7Iha+LRhVbEIghA6HDHgY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784282764; c=relaxed/simple; bh=RG25JUTT6jRwzLcxWm4pzeaSJI+Gk7yxAACeKGvCT58=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cnLU6QR9BjHHtMetmJCjZ6AYVgo3Vyyn2ApiredEF/zdxhYbU6qlWkjRFGPSEThb/+ucqZypXva3IFXWdV9LRrOaWiG3UROHAYELUOCDjCmc4+pmwFGqm1ruZoglVdbaQHHdOkuSfN/iIcXuZNRUEoprMlb1nCXOLTdRwp5fh0g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=OCioZtpV; arc=none smtp.client-ip=115.124.30.118 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="OCioZtpV" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1784282757; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=Yw64uU14GuTuPthkhn4VxnbV9rEImM2ZT7Hcgjg5RJE=; b=OCioZtpVGFy8hhwiVDFESXpuvHwbIR3nlK1a0Y1EqAEwKtLKJcnZfNyDE1j+iDt28ftOdHfkaP18L+PNhHsKRwsjZN86ldk6xdud2Ne0RSJ0/aGfuhsi6w4WmCZKDnORd/GYEeh4Ybv1jt9l++nbJWF98zXADr4X5RvPmJq9n/8= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R211e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033045098064;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=21;SR=0;TI=SMTPD_---0X7Gx5d-_1784282755; Received: from localhost(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0X7Gx5d-_1784282755 cluster:ay36) by smtp.aliyun-inc.com; Fri, 17 Jul 2026 18:05:56 +0800 From: Baolin Wang To: akpm@linux-foundation.org, david@kernel.org, ljs@kernel.org, hannes@cmpxchg.org Cc: riel@surriel.com, liam@infradead.org, vbabka@kernel.org, harry@kernel.org, jannh@google.com, lance.yang@linux.dev, kasong@tencent.com, qi.zheng@linux.dev, shakeel.butt@linux.dev, baohua@kernel.org, axelrasmussen@google.com, yuanchu@google.com, weixugc@google.com, mhocko@kernel.org, baolin.wang@linux.alibaba.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 2/2] mm: mglru: promote mapped executable folios after first usage Date: Fri, 17 Jul 2026 18:05:34 +0800 Message-ID: <7db4d1975cf04e3e48157f98bdf398565ee189a4.1784268206.git.baolin.wang@linux.alibaba.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Classical LRU protects mapped executable file folios through commit 8cab4754d24a0 ("vmscan: make mapped executable pages the first class citizen") and commit c909e99364c8 ("vmscan: activate executable pages after first usage"), giving executable code a better chance to stay in memory, avoiding IO thrashing and improving workload performance. However, MGLRU's protection of mapped executable file folios is less reliable. Although shrink_folio_list() checks references, the access flag of mapped executable file folios may have already been checked and cleared by lru_gen_look_around() or walk_mm(). Additionally, folio_update_gen() or lru_gen_set_refs() only sets the 'PG_referenced' flag for mapped executable file folios, which causes shrink_folio_list() to ignore the first usage of these mapped executable file folios and reclaim them easily. Follow the classical LRU's logic, promoting mapped executable file folios after their first usage in folio_update_gen() and lru_gen_set_refs(), giving executable code a better chance to stay in memory. On my 32-core Arm machine, with the memcg limit set to 2G, running 'make -j32' to build kernel showed some improvement in sys time. base patched 9248.543s 7861.579s While we are at it, introduce a new helper to check mapped executable file folios. Signed-off-by: Baolin Wang Acked-by: Johannes Weiner Reviewed-by: Axel Rasmussen --- mm/vmscan.c | 47 +++++++++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index de62899c108d..1040bf9f96e8 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -268,6 +268,12 @@ static int sc_swappiness(struct scan_control *sc, stru= ct mem_cgroup *memcg) } #endif =20 +static inline bool is_exec_file_folio(const struct folio *folio, + const vma_flags_t *vma_flags) +{ + return vma_flags_test(vma_flags, VMA_EXEC_BIT) && folio_is_file_lru(folio= ); +} + static void set_task_reclaim_state(struct task_struct *task, struct reclaim_state *rs) { @@ -835,11 +841,15 @@ enum folio_references { * with PG_active set. In contrast, the aging (page table walk) path uses * folio_update_gen(). */ -static bool lru_gen_set_refs(struct folio *folio) +static bool lru_gen_set_refs(struct folio *folio, const vma_flags_t *vma_f= lags) { /* see the comment on LRU_REFS_FLAGS */ if (!folio_test_referenced(folio) && !folio_test_workingset(folio)) { set_mask_bits(&folio->flags.f, LRU_REFS_MASK, BIT(PG_referenced)); + /* Activate file-backed executable folios after first usage. */ + if (is_exec_file_folio(folio, vma_flags)) + return true; + return false; } =20 @@ -851,7 +861,7 @@ static bool lru_gen_set_refs(struct folio *folio) return true; } #else -static bool lru_gen_set_refs(struct folio *folio) +static bool lru_gen_set_refs(struct folio *folio, const vma_flags_t *vma_f= lags) { return false; } @@ -886,7 +896,7 @@ static enum folio_references folio_check_references(str= uct folio *folio, if (!referenced_ptes) return FOLIOREF_RECLAIM; =20 - return lru_gen_set_refs(folio) ? FOLIOREF_ACTIVATE : FOLIOREF_KEEP; + return lru_gen_set_refs(folio, &vma_flags) ? FOLIOREF_ACTIVATE : FOLIORE= F_KEEP; } =20 referenced_folio =3D folio_test_clear_referenced(folio); @@ -914,7 +924,7 @@ static enum folio_references folio_check_references(str= uct folio *folio, /* * Activate file-backed executable folios after first usage. */ - if (vma_flags_test(&vma_flags, VMA_EXEC_BIT) && folio_is_file_lru(folio)) + if (is_exec_file_folio(folio, &vma_flags)) return FOLIOREF_ACTIVATE; =20 return FOLIOREF_KEEP; @@ -2119,7 +2129,7 @@ static void shrink_active_list(unsigned long nr_to_sc= an, * IO, plus JVM can create lots of anon VM_EXEC folios, * so we ignore them here. */ - if (vma_flags_test(&vma_flags, VMA_EXEC_BIT) && folio_is_file_lru(folio= )) { + if (is_exec_file_folio(folio, &vma_flags)) { nr_rotated +=3D folio_nr_pages(folio); list_add(&folio->lru, &l_active); continue; @@ -3188,7 +3198,7 @@ static bool positive_ctrl_err(struct ctrl_pos *sp, st= ruct ctrl_pos *pv) *************************************************************************= *****/ =20 /* promote pages accessed through page tables */ -static int folio_update_gen(struct folio *folio, int gen) +static int folio_update_gen(struct folio *folio, int gen, const vma_flags_= t *vma_flags) { unsigned long new_flags, old_flags =3D READ_ONCE(folio->flags.f); =20 @@ -3196,10 +3206,15 @@ static int folio_update_gen(struct folio *folio, in= t gen) =20 /* see the comment on LRU_REFS_FLAGS */ if (!folio_test_referenced(folio) && !folio_test_workingset(folio)) { + /* Activate file-backed executable folios after first usage. */ + if (is_exec_file_folio(folio, vma_flags)) + goto promote; + set_mask_bits(&folio->flags.f, LRU_REFS_MASK, BIT(PG_referenced)); return -1; } =20 +promote: do { /* lru_gen_del_folio() has isolated this page? */ if (!(old_flags & LRU_GEN_MASK)) @@ -3428,8 +3443,8 @@ static bool suitable_to_scan(int total, int young) return young * n >=3D total; } =20 -static void walk_update_folio(struct lru_gen_mm_walk *walk, struct folio *= folio, - int new_gen, bool dirty) +static void walk_update_folio(struct lru_gen_mm_walk *walk, struct vm_area= _struct *vma, + struct folio *folio, int new_gen, bool dirty) { int old_gen; =20 @@ -3442,10 +3457,10 @@ static void walk_update_folio(struct lru_gen_mm_wal= k *walk, struct folio *folio, folio_mark_dirty(folio); =20 if (walk) { - old_gen =3D folio_update_gen(folio, new_gen); + old_gen =3D folio_update_gen(folio, new_gen, &vma->flags); if (old_gen >=3D 0 && old_gen !=3D new_gen) update_batch_size(walk, folio, old_gen, new_gen); - } else if (lru_gen_set_refs(folio)) { + } else if (lru_gen_set_refs(folio, &vma->flags)) { old_gen =3D folio_lru_gen(folio); if (old_gen >=3D 0 && old_gen !=3D new_gen) folio_activate(folio); @@ -3518,7 +3533,7 @@ static bool walk_pte_range(pmd_t *pmd, unsigned long = start, unsigned long end, continue; =20 if (last !=3D folio) { - walk_update_folio(walk, last, gen, dirty); + walk_update_folio(walk, args->vma, last, gen, dirty); =20 last =3D folio; dirty =3D false; @@ -3531,7 +3546,7 @@ static bool walk_pte_range(pmd_t *pmd, unsigned long = start, unsigned long end, walk->mm_stats[MM_LEAF_YOUNG] +=3D nr; } =20 - walk_update_folio(walk, last, gen, dirty); + walk_update_folio(walk, args->vma, last, gen, dirty); last =3D NULL; =20 if (i < PTRS_PER_PTE && get_next_vma(PMD_MASK, PAGE_SIZE, args, &start, &= end)) @@ -3609,7 +3624,7 @@ static void walk_pmd_range_locked(pud_t *pud, unsigne= d long addr, struct vm_area goto next; =20 if (last !=3D folio) { - walk_update_folio(walk, last, gen, dirty); + walk_update_folio(walk, vma, last, gen, dirty); =20 last =3D folio; dirty =3D false; @@ -3623,7 +3638,7 @@ static void walk_pmd_range_locked(pud_t *pud, unsigne= d long addr, struct vm_area i =3D i > MIN_LRU_BATCH ? 0 : find_next_bit(bitmap, MIN_LRU_BATCH, i) + = 1; } while (i <=3D MIN_LRU_BATCH); =20 - walk_update_folio(walk, last, gen, dirty); + walk_update_folio(walk, vma, last, gen, dirty); =20 lazy_mmu_mode_disable(); spin_unlock(ptl); @@ -4258,7 +4273,7 @@ bool lru_gen_look_around(struct page_vma_mapped_walk = *pvmw, unsigned int nr) continue; =20 if (last !=3D folio) { - walk_update_folio(walk, last, gen, dirty); + walk_update_folio(walk, vma, last, gen, dirty); =20 last =3D folio; dirty =3D false; @@ -4270,7 +4285,7 @@ bool lru_gen_look_around(struct page_vma_mapped_walk = *pvmw, unsigned int nr) young +=3D nr; } =20 - walk_update_folio(walk, last, gen, dirty); + walk_update_folio(walk, vma, last, gen, dirty); =20 lazy_mmu_mode_disable(); =20 --=20 2.47.3