Message ID | 20250131001806.92349-1-vishal.moola@gmail.com (mailing list archive) |
---|---|
Headers | show |
Series | vmalloc: Introduce vmap_file() | expand |
On Thu, 30 Jan 2025 16:18:04 -0800 "Vishal Moola (Oracle)" <vishal.moola@gmail.com> wrote: > Currently, users have to call vmap() or vmap_pfn() to map pages to > kernel virtual space. vmap() requires the page references, and > vmap_pfn() requires page pfns. If we have a file but no page references, > we have to do extra work to map them. > > Create a function, vmap_file(), to map a specified range of a given > file to kernel virtual space. Also convert a user that benefits from > vmap_file(). > Seems like a pretty specialized thing. Have you identified any other potential users of vmap_file()? I couldn't see any. If drm is likely to remain the only user of this, perhaps we should leave the code down in drivers/gpu/drm for now? Also, the amount of copy-n-pasting from vmap() into vmap_file() is undesirable - code size, maintenance overhead, etc.
On Thu, Jan 30, 2025 at 04:18:04PM -0800, Vishal Moola (Oracle) wrote: > Currently, users have to call vmap() or vmap_pfn() to map pages to > kernel virtual space. vmap() requires the page references, and > vmap_pfn() requires page pfns. If we have a file but no page references, > we have to do extra work to map them. > > Create a function, vmap_file(), to map a specified range of a given > file to kernel virtual space. Also convert a user that benefits from > vmap_file(). As far as I can tell there is exatly one user that maps file pages into vmalloc space. It's a pretty odd thing to do, so figuring out a way to get rid of that might be a better use of time.