Re: [PATCH] /dev/zero: make private mapping full anonymous mapping
From: Christoph Lameter (Ampere)
Date: Wed Jan 15 2025 - 17:30:39 EST
On Wed, 15 Jan 2025, Yang Shi wrote:
>
> > > I just thought of named anonymous VMA may help. We can give the private
> > > /dev/zero mapping a name, for example, just "/dev/zero". However,
> > > "[anon:/dev/zero]" will show up in smaps/maps. We can't keep the device
> > > numbers and inode number either, but it seems it can tell the user this
> > > mapping comes from /dev/zero, and it also explicitly tells us it is
> > > specially treated by kernel. Hopefully setting anon_name is permitted.
> > But then that'd require CONFIG_ANON_VMA_NAME unfortunately :(
>
> Yes.
Add a counter for NULL pages in smaps?
I.e.
Null: 4 kB
Both anonymous and file mappings could have NULL page references right?