]> git.baikalelectronics.ru Git - kernel.git/commit
mm, vmalloc: use __GFP_HIGHMEM implicitly
authorMichal Hocko <mhocko@suse.com>
Mon, 8 May 2017 22:57:44 +0000 (15:57 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 9 May 2017 00:15:13 +0000 (17:15 -0700)
commit8584ca7b2fee3562751111bc1f304aa436f64b46
tree19c6c68f96d55ea25b71040a448c6890301a19f6
parent2f3c8ccb2d6c878d02bec0cd8db6d3643835adb6
mm, vmalloc: use __GFP_HIGHMEM implicitly

__vmalloc* allows users to provide gfp flags for the underlying
allocation.  This API is quite popular

  $ git grep "=[[:space:]]__vmalloc\|return[[:space:]]*__vmalloc" | wc -l
  77

The only problem is that many people are not aware that they really want
to give __GFP_HIGHMEM along with other flags because there is really no
reason to consume precious lowmemory on CONFIG_HIGHMEM systems for pages
which are mapped to the kernel vmalloc space.  About half of users don't
use this flag, though.  This signals that we make the API unnecessarily
too complex.

This patch simply uses __GFP_HIGHMEM implicitly when allocating pages to
be mapped to the vmalloc space.  Current users which add __GFP_HIGHMEM
are simplified and drop the flag.

Link: http://lkml.kernel.org/r/20170307141020.29107-1-mhocko@kernel.org
Signed-off-by: Michal Hocko <mhocko@suse.com>
Reviewed-by: Matthew Wilcox <mawilcox@microsoft.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: David Rientjes <rientjes@google.com>
Cc: Cristopher Lameter <cl@linux.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
20 files changed:
arch/parisc/kernel/module.c
arch/x86/kernel/module.c
drivers/block/drbd/drbd_bitmap.c
drivers/gpu/drm/etnaviv/etnaviv_dump.c
drivers/md/dm-bufio.c
fs/btrfs/free-space-tree.c
fs/file.c
fs/xfs/kmem.c
include/drm/drm_mem_util.h
kernel/bpf/core.c
kernel/bpf/syscall.c
kernel/fork.c
kernel/groups.c
kernel/module.c
mm/kasan/kasan.c
mm/nommu.c
mm/util.c
mm/vmalloc.c
net/ceph/ceph_common.c
net/netfilter/x_tables.c