Re: [PATCH v6 11/20] mm: shmem: use SHMEM_F_* flags instead of VM_* flags
From: Pasha Tatashin
Date: Mon Nov 17 2025 - 13:25:58 EST
On Mon, Nov 17, 2025 at 4:48 AM Mike Rapoport <rppt@xxxxxxxxxx> wrote:
>
> On Sat, Nov 15, 2025 at 06:33:57PM -0500, Pasha Tatashin wrote:
> > From: Pratyush Yadav <ptyadav@xxxxxxxxx>
> >
> > shmem_inode_info::flags can have the VM flags VM_NORESERVE and
> > VM_LOCKED. These are used to suppress pre-accounting or to lock the
> > pages in the inode respectively. Using the VM flags directly makes it
> > difficult to add shmem-specific flags that are unrelated to VM behavior
> > since one would need to find a VM flag not used by shmem and re-purpose
> > it.
> >
> > Introduce SHMEM_F_NORESERVE and SHMEM_F_LOCKED which represent the same
> > information, but their bits are independent of the VM flags. Callers can
> > still pass VM_NORESERVE to shmem_get_inode(), but it gets transformed to
> > the shmem-specific flag internally.
> >
> > No functional changes intended.
> >
> > Signed-off-by: Pratyush Yadav <ptyadav@xxxxxxxxx>
> > Signed-off-by: Pasha Tatashin <pasha.tatashin@xxxxxxxxxx>
>
> Reviewed-by: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx>
Thank you.
Pasha