Re: [PATCH 2/3] mm: abstract reading sysctl_max_map_count, and READ_ONCE()

From: Pedro Falcato

Date: Fri Mar 27 2026 - 05:20:38 EST


On Wed, Mar 11, 2026 at 05:24:37PM +0000, Lorenzo Stoakes (Oracle) wrote:
> Concurrent reads and writes of sysctl_max_map_count are possible, so we
> should READ_ONCE() and WRITE_ONCE().
>
> The sysctl procfs logic already enforces WRITE_ONCE(), so abstract the read
> side with get_sysctl_max_map_count().
>
> While we're here, also move the field to mm/internal.h and add the getter
> there since only mm interacts with it, there's no need for anybody else to
> have access.
>
> Finally, update the VMA userland tests to reflect the change.
>
> Signed-off-by: Lorenzo Stoakes (Oracle) <ljs@xxxxxxxxxx>

Reviewed-by: Pedro Falcato <pfalcato@xxxxxxx>

--
Pedro