]> git.karo-electronics.de Git - karo-tx-linux.git/commit
rbtree: low level optimizations in __rb_erase_color()
authorMichel Lespinasse <walken@google.com>
Tue, 14 Aug 2012 03:22:42 +0000 (13:22 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 22 Aug 2012 06:01:35 +0000 (16:01 +1000)
commit5ab16e46f09f00b0a69b4b7885df8a8d5903e5a4
tree8bd7b06e8fdb0e1a51239d0dbcf32a1ce8cab7e1
parentb0cfc9877aa47380d7f72562f254e3fec3857995
rbtree: low level optimizations in __rb_erase_color()

In __rb_erase_color(), we often already have pointers to the nodes being
rotated and/or know what their colors must be, so we can generate more
efficient code than the generic __rb_rotate_left() and __rb_rotate_right()
functions.

Also when the current node is red or when flipping the sibling's color,
the parent is already known so we can use the more efficient
rb_set_parent_color() function to set the desired color.

Signed-off-by: Michel Lespinasse <walken@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Acked-by: David Woodhouse <David.Woodhouse@intel.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Daniel Santos <daniel.santos@pobox.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/rbtree.c