]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm, vmalloc: only call setup_vmalloc_vm() only in __get_vm_area_node()
authorZhang Yanfei <zhangyanfei@cn.fujitsu.com>
Wed, 19 Jun 2013 00:06:42 +0000 (10:06 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 19 Jun 2013 07:13:26 +0000 (17:13 +1000)
commitcec3bfcb44284cf843e89950d65c4f8b6c0ca6d5
tree0ef723ee4ab061ece21c3fa98b159567164285cf
parent9227f8caaf734b683683fe1b97142720f62639f3
mm, vmalloc: only call setup_vmalloc_vm() only in __get_vm_area_node()

Now for insert_vmalloc_vm, it only calls the two functions:
- setup_vmalloc_vm: fill vm_struct and vmap_area instances
- clear_vm_unlist: clear VM_UNLIST bit in vm_struct->flags

So in __get_vm_area_node(), if VM_UNLIST bit unset in flags, that is the
else branch here, we don't need to clear VM_UNLIST bit for vm->flags since
this bit is obviously not set.  That is to say, we could only call
setup_vmalloc_vm instead of insert_vmalloc_vm here.  And then we could
even remove the if test here.

Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Acked-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/vmalloc.c