lkml.org 
[lkml]   [2021]   [Jan]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] mm/vmalloc: Separate put pages and flush VM flags
On Wed, Jan 20, 2021 at 05:41:18PM -0800, Rick Edgecombe wrote:
> When VM_MAP_PUT_PAGES was added, it was defined with the same value as
> VM_FLUSH_RESET_PERMS. This doesn't seem like it will cause any big
> functional problems other than some excess flushing for VM_MAP_PUT_PAGES
> allocations.
>
> Redefine VM_MAP_PUT_PAGES to have its own value. Also, move the comment
> and remove whitespace for VM_KASAN such that the flags lower down are less
> likely to be missed in the future.

Er ... I think the problem was that VM_FLUSH_RESET_PERMS was put away from
all the other flags!

Why not this?

diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index 938eaf9517e26..458c41b99215e 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -24,7 +24,8 @@ 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 */
+#define VM_FLUSH_RESET_PERMS 0x00000100 /* Reset direct map and flush TLB on unmap. cannot be freed in atomic context */
+#define VM_MAP_PUT_PAGES 0x00000200 /* put pages and free array in vfree */

/*
* VM_KASAN is used slighly differently depending on CONFIG_KASAN_VMALLOC.
@@ -37,12 +38,6 @@ struct notifier_block; /* in notifier.h */
* determine which allocations need the module shadow freed.
*/

-/*
- * Memory with VM_FLUSH_RESET_PERMS cannot be freed in an interrupt or with
- * vfree_atomic().
- */
-#define VM_FLUSH_RESET_PERMS 0x00000100 /* Reset direct map and flush TLB on unmap */
-
/* bits [20..32] reserved for arch specific ioremap internals */

/*
\
 
 \ /
  Last update: 2021-01-21 19:07    [W:0.518 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site