]> 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>
Thu, 27 Jun 2013 23:52:10 +0000 (09:52 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 28 Jun 2013 06:37:55 +0000 (16:37 +1000)
commita55daa12cc9638b68ecb96439bff88e734012994
treee0373d6d8bf25d76a2cb331921800785cc02d842
parent59094e4d65f2d35d56f28cab327410b1509f7e1f
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