Skip to content

Commit

Permalink
mm/vmalloc: separate put pages and flush VM flags
Browse files Browse the repository at this point in the history
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, rearrange things
so flags are less likely to be missed in the future.

Link: https://lkml.kernel.org/r/[email protected]
Fixes: b944afc ("mm: add a VM_MAP_PUT_PAGES flag for vmap")
Signed-off-by: Rick Edgecombe <[email protected]>
Suggested-by: Matthew Wilcox <[email protected]>
Cc: Miaohe Lin <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Daniel Axtens <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
rpedgeco authored and torvalds committed Feb 5, 2021
1 parent 74e2148 commit 4f6ec86
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions include/linux/vmalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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, can't 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.
Expand All @@ -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 */

/*
Expand Down

0 comments on commit 4f6ec86

Please sign in to comment.