> The bpf_map->ops->map_mmap callback invoked by bpf_map_mmap() can be set to
> one of ringbuf_map_mmap_kern(), ringbuf_map_mmap_user(), array_map_mmap()
> or arena_map_mmap().
> 
> It is convention in mm to mark mappings whose pages the kernel manages
> itself with VM_MIXEDMAP, so core mm knows not to treat them as ordinary
> page cache or anonymous memory.
> 
> The map_mmap callbacks ringbuf_map_mmap_kern() and ringbuf_map_mmap_user()
> use remap_vmalloc_range(), which ultimately invokes vm_insert_page() and so
> marks the ranges VM_MIXEDMAP, and array_map_mmap() sets VM_MIXEDMAP
> explicitly.
> 
> However, the exception to this is arena_map_mmap(), which doesn't set the
> flag.
> [ ... ]
> in bpf_map_mmap().
> 
> Reviewed-by: Emil Tsalapatis <[email protected]>
> Reviewed-by: Suren Baghdasaryan <[email protected]>
> Signed-off-by: Lorenzo Stoakes (ARM) <[email protected]>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/20261009-b4-mmap-prepare-vma-flag-sanify-v5-0-923b70125...@kernel.org?part=13


Reply via email to