Skip to contentSkip to conversation

mm-add-a-vm_map_put_pages-flag-for-vmap.patch removed from -mm tree

merged [email protected] 1 participant 1 message Oct 22, 2020

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: mm: add a VM_MAP_PUT_PAGES flag for vmap
has been removed from the -mm tree. Its filename was
mm-add-a-vm_map_put_pages-flag-for-vmap.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Christoph Hellwig <[email protected]>
Subject: mm: add a VM_MAP_PUT_PAGES flag for vmap

Add a flag so that vmap takes ownership of the passed in page array. When vfree is called on such an allocation it will put one reference on each page, and free the page array itself.

Cc Boris Ostrovsky <[email protected]>
Cc Chris Wilson <[email protected]>
Cc Jani Nikula <[email protected]>
Cc Joonas Lahtinen <[email protected]>
Cc Juergen Gross <[email protected]>
Cc Matthew Auld <[email protected]>
Cc "Matthew Wilcox (Oracle)" <[email protected]>
Cc Minchan Kim <[email protected]>
Cc Nitin Gupta <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Rodrigo Vivi <[email protected]>
Cc Stefano Stabellini <[email protected]>
Cc Tvrtko Ursulin <[email protected]>
Cc Uladzislau Rezki (Sony) <[email protected]>

---

 include/linux/vmalloc.h |    1 +
 mm/vmalloc.c            |    9 +++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)
include/linux/vmalloc.h renamed from include/linux/vmalloc.h~mm-add-a-vm_map_put_pages-flag-for-vmap +1 -0
@@ -24,6 +24,7 @@ struct notifier_block;		/* in notifier.h
 #define VM_UNINITIALIZED	0x00000020	/* vm_struct is not fully initialized */
 #define VM_NO_GUARD		0x00000040      /* don't add guard page */
 #define VM_KASAN		0x00000080      /* has allocated kasan shadow memory */
+#define VM_MAP_PUT_PAGES	0x00000100	/* put pages and free array in vfree */
 
 /*
  * VM_KASAN is used slighly differently depending on CONFIG_KASAN_VMALLOC.
mm/vmalloc.c renamed from mm/vmalloc.c~mm-add-a-vm_map_put_pages-flag-for-vmap +7 -2
@@ -2377,8 +2377,11 @@ EXPORT_SYMBOL(vunmap);
  * @flags: vm_area->flags
  * @prot: page protection for the mapping
  *
- * Maps @count pages from @pages into contiguous kernel virtual
- * space.
+ * Maps @count pages from @pages into contiguous kernel virtual space.
+ * If @flags contains %VM_MAP_PUT_PAGES the ownership of the pages array itself
+ * (which must be kmalloc or vmalloc memory) and one reference per pages in it
+ * are transferred from the caller to vmap(), and will be freed / dropped when
+ * vfree() is called on the return value.
  *
  * Return: the address of the area or %NULL on failure
  */
@@ -2404,6 +2407,8 @@ void *vmap(struct page **pages, unsigned
 		return NULL;
 	}
 
+	if (flags & VM_MAP_PUT_PAGES)
+		area->pages = pages;
 	return area->addr;
 }
 EXPORT_SYMBOL(vmap);

_

Patches currently in -mm which might be from [email protected] are