Thread (15 messages) 15 messages, 3 authors, 2025-08-18

Re: [PATCH v2 4/5] mm: add largest_zero_folio() routine

From: Hannes Reinecke <hare@suse.de>
Date: 2025-08-18 12:04:24
Also in: linux-fsdevel, linux-mm, lkml

On 8/8/25 14:11, Pankaj Raghav (Samsung) wrote:
From: Pankaj Raghav <redacted>

The callers of mm_get_huge_zero_folio() have access to a mm struct and
the lifetime of the huge_zero_folio is tied to the lifetime of the mm
struct.

largest_zero_folio() will give access to huge_zero_folio when
PERSISTENT_HUGE_ZERO_FOLIO config option is enabled for callers that do not
want to tie the lifetime to a mm struct. This is very useful for
filesystem and block layers where the request completions can be async
and there is no guarantee on the mm struct lifetime.

This function will return a ZERO_PAGE folio if PERSISTENT_HUGE_ZERO_FOLIO
is disabled or if we failed to allocate a huge_zero_folio during early
init.

Co-developed-by: David Hildenbrand <redacted>
Signed-off-by: David Hildenbrand <redacted>
Signed-off-by: Pankaj Raghav <redacted>
---
  include/linux/huge_mm.h | 22 ++++++++++++++++++++++
  1 file changed, 22 insertions(+)
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                  Kernel Storage Architect
hare@suse.de                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help