Re: [PATCH] mm/shmem: avoid zeroing new folios twice with init_on_alloc=1

From: Fnu Samridh

Date: Tue Nov 17 2026 - 23:59:16 EST


On Tue, Nov 17, 2026 at 10:29 PM Baolin Wang
<baolin.wang@xxxxxxxxxxxxxxxxx> wrote:
> I don't like the GFP flag hack. Why not use user_alloc_needs_zeroing()
> to decide whether we need to zero folios, like anonymous memory does?

I started with user_alloc_needs_zeroing(), but switched after a comment
on the list, thinking the helper wouldn't be accepted here. My mistake.
I'll go back to it in v2, which also takes care of my flush_dcache_folio()
question. Thanks!