Re: [PATCH v2 bpf-next 3/3] mm: Introduce VM_SPARSE kind and vm_area_[un]map_pages().

2024-02-29 Thread Christoph Hellwig
On Tue, Feb 27, 2024 at 05:31:28PM -0800, Alexei Starovoitov wrote: > What would it look like with a cookie? > A static inline wrapper around get_vm_area() that returns area->addr ? > And the start address of vmap range will be such a cookie? Hmm, just making the kernel virtual address the cookie

Re: [PATCH v2 bpf-next 3/3] mm: Introduce VM_SPARSE kind and vm_area_[un]map_pages().

2024-02-27 Thread Alexei Starovoitov
On Tue, Feb 27, 2024 at 9:59 AM Christoph Hellwig wrote: > > > privately-managed pages into a sparse vm area with the following steps: > > > > area = get_vm_area(area_size, VM_SPARSE); // at bpf prog verification > > time > > vm_area_map_pages(area, kaddr, 1, page); // on demand > >

Re: [PATCH v2 bpf-next 3/3] mm: Introduce VM_SPARSE kind and vm_area_[un]map_pages().

2024-02-27 Thread Christoph Hellwig
> privately-managed pages into a sparse vm area with the following steps: > > area = get_vm_area(area_size, VM_SPARSE); // at bpf prog verification time > vm_area_map_pages(area, kaddr, 1, page); // on demand > // it will return an error if kaddr is out of range >

[PATCH v2 bpf-next 3/3] mm: Introduce VM_SPARSE kind and vm_area_[un]map_pages().

2024-02-23 Thread Alexei Starovoitov
From: Alexei Starovoitov vmap/vmalloc APIs are used to map a set of pages into contiguous kernel virtual space. get_vm_area() with appropriate flag is used to request an area of kernel address range. It'se used for vmalloc, vmap, ioremap, xen use cases. - vmalloc use case dominates the usage.