[PATCH] mm: rename in_lru_cache to maybe_in_lru_cache

From: Barry Song (Xiaomi)

Date: Wed Jul 08 2026 - 10:46:43 EST


!folio_test_lru(folio) doesn't necessarily mean folio
is in lru cache. so let's put "maybe" prefix.

Suggested-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
Signed-off-by: Barry Song (Xiaomi) <baohua@xxxxxxxxxx>
---
mm/memory.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/mm/memory.c b/mm/memory.c
index 5689b7cff76c..631c170f812a 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -4174,7 +4174,7 @@ static bool __wp_can_reuse_large_anon_folio(struct folio *folio,
static bool wp_can_reuse_anon_folio(struct folio *folio,
struct vm_area_struct *vma)
{
- const bool in_lru_cache = !folio_test_lru(folio);
+ const bool maybe_in_lru_cache = !folio_test_lru(folio);
const bool in_swapcache = folio_test_swapcache(folio);

if (IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE) && folio_test_large(folio))
@@ -4188,9 +4188,9 @@ static bool wp_can_reuse_anon_folio(struct folio *folio,
* KSM doesn't necessarily raise the folio refcount.
*/
if (folio_test_ksm(folio) ||
- folio_ref_count(folio) > 1 + in_lru_cache + in_swapcache)
+ folio_ref_count(folio) > 1 + maybe_in_lru_cache + in_swapcache)
return false;
- if (in_lru_cache)
+ if (maybe_in_lru_cache)
/*
* We cannot easily detect+handle references from
* remote LRU caches or references to LRU folios.
--
2.39.3 (Apple Git-146)


>
> --
> Cheers,
>
> David