Re: [PATCH 2/6] mm: implement file_is_dev_zero() to uniquely identify /dev/zero

From: Lorenzo Stoakes (ARM)

Date: Mon Sep 07 2026 - 12:34:02 EST


On Mon, Sep 07, 2026 at 06:21:27PM +0200, David Hildenbrand (Arm) wrote:
> On 9/2/26 20:00, Lorenzo Stoakes (ARM) wrote:
> > To lay the foundation for a future change that converts
> > MAP_PRIVATE-/dev/zero mappings to be truly anonymous, add the ability to
> > uniquely identify these mappings.
> >
> > With the memory character device now part of mm/ this is trivially
> > achievable through a file_is_dev_zero() predicate that simply tests that
> > the file operation hooks are zero_fops.
> >
> > Also update userland VMA tests to expose file_is_dev_zero() and provide
> > a stub zero_fops for testing.
> >
> > Signed-off-by: Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx>
> > ---
>
> yes!
>
> Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>

I thought you might like these ;)

Thanks for pushing back last cycle, this is MUCH better. Struck me that
actually that it's trivial + requires no fugliness the second we have it
mm/.

>
> --
> Cheers,
>
> David

--
Cheers, Lorenzo