linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v2 0/1] Introduce vmap_file()
@ 2025-03-28 21:13 Vishal Moola (Oracle)
  2025-03-28 21:13 ` [RFC PATCH v2 1/1] mm/vmalloc: " Vishal Moola (Oracle)
  2025-03-31  2:05 ` [RFC PATCH v2 0/1] " Huan Yang
  0 siblings, 2 replies; 11+ messages in thread
From: Vishal Moola (Oracle) @ 2025-03-28 21:13 UTC (permalink / raw)
  To: linux-mm
  Cc: Andrew Morton, Brendan Jackman, Huan Yang, linux-kernel,
	Vishal Moola (Oracle)

Currently, users have to call vmap() or vmap_pfn() to map pages to
kernel virtual space. vmap_pfn() is for special pages (i.e. pfns
without struct page). vmap() handles normal pages.

With large folios, we may want to map ranges that only span
part of a folio (i.e. mapping half of a 2Mb folio).
vmap_file() will allow us to do so.
 
Create a function, vmap_file(), to map a specified range of a given
file to kernel virtual space. vmap_file() is an in-kernel equivalent
to mmap(), and can be useful for filesystems.

---
v2:
  - Reword cover letter to provide a clearer overview of the current
  vmalloc APIs, and usefulness of vmap_file()
  - EXPORT_SYMBOL_GPL() instead of EXPORT_SYMBOL()
  - Provide support to partially map file folios
  - Demote this to RFC while we look for users
--
I don't have a user for this function right now, but it will be
useful as users start converting to using large folios. I'm just
putting it out here for anyone that may find a use for it.

This seems like the sensible way to implement it, but I'm open
to tweaking the functions semantics.

I've Cc-ed a couple people that mentioned they might be interested
in using it.

Vishal Moola (Oracle) (1):
  mm/vmalloc: Introduce vmap_file()

 include/linux/vmalloc.h |   2 +
 mm/vmalloc.c            | 113 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 115 insertions(+)

-- 
2.48.1



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-04-01 17:31 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-28 21:13 [RFC PATCH v2 0/1] Introduce vmap_file() Vishal Moola (Oracle)
2025-03-28 21:13 ` [RFC PATCH v2 1/1] mm/vmalloc: " Vishal Moola (Oracle)
2025-03-31  2:05 ` [RFC PATCH v2 0/1] " Huan Yang
2025-04-01  1:50   ` Vishal Moola (Oracle)
2025-04-01  2:21     ` Huan Yang
2025-04-01  3:19       ` Vishal Moola (Oracle)
2025-04-01  6:08         ` Huan Yang
2025-04-01  9:47           ` Uladzislau Rezki
2025-04-01 11:09             ` Huan Yang
2025-04-01 16:43               ` Uladzislau Rezki
2025-04-01 17:31           ` Vishal Moola (Oracle)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox