Re: [PATCH mm-new v4 4/6] mm: add folio_is_lazyfree helper

From: David Hildenbrand (Red Hat)

Date: Wed Jan 14 2026 - 06:45:11 EST


On 1/11/26 14:41, Lance Yang wrote:


On 2026/1/11 20:19, Vernon Yang wrote:
Add folio_is_lazyfree() function to identify lazy-free folios to improve
code readability.

Signed-off-by: Vernon Yang <yanglincheng@xxxxxxxxxx>
---
include/linux/mm_inline.h | 5 +++++
mm/rmap.c | 2 +-
mm/vmscan.c | 5 ++---
3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h
index fa2d6ba811b5..65a4ae52d915 100644
--- a/include/linux/mm_inline.h
+++ b/include/linux/mm_inline.h
@@ -35,6 +35,11 @@ static inline int page_is_file_lru(struct page *page)
return folio_is_file_lru(page_folio(page));
}
+static inline int folio_is_lazyfree(const struct folio *folio)
+{

It's 2026, could we use bool instead of int?

Yeah, I see folio_is_file_lru() uses int but that's legacy ...

Right, and why not call the function folio_test_lazyfree() and move it to page-flags.h?

No strong opinion, just a thought.

Acked-by: David Hildenbrand (Red Hat) <david@xxxxxxxxxx>

--
Cheers

David