]> git.karo-electronics.de Git - karo-tx-linux.git/commit
vmalloc: walk vmap_areas by sorted list instead of rb_next()
authorHong zhi guo <honkiko@gmail.com>
Sat, 21 Jul 2012 00:53:54 +0000 (10:53 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 25 Jul 2012 03:02:21 +0000 (13:02 +1000)
commit95858ce7c578a1709d8fd016d863d9a71d1132cc
tree3f8c7a6826199d0f2174e96ff19b3313b8049a4f
parent120bdb66ef6115d80abc4982755d9095063bb9a0
vmalloc: walk vmap_areas by sorted list instead of rb_next()

There's a walk by repeating rb_next to find a suitable hole.  Could be
simply replaced by walk on the sorted vmap_area_list.  More simpler and
efficient.

Mutation of the list and tree only happens in pair within
__insert_vmap_area and __free_vmap_area, under protection of
vmap_area_lock.  The patch code is also under vmap_area_lock, so the list
walk is safe, and consistent with the tree walk.

Tested on SMP by repeating batch of vmalloc anf vfree for random sizes and
rounds for hours.

Signed-off-by: Hong Zhiguo <honkiko@gmail.com>
Cc: Nick Piggin <npiggin@kernel.dk>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/vmalloc.c