diff options
author | Michel Lespinasse <walken@google.com> | 2012-10-08 16:31:02 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-09 16:22:35 +0900 |
commit | 59633abf34e2f44b8e772a2c12a92132aa7c2220 (patch) | |
tree | 3a260a6100ae2c3e2dbade989c3692234081f1c7 /lib/rbtree_test.c | |
parent | 7ce6ff9e5de99e7b72019c7de82fb438fe1dc5a0 (diff) | |
download | linux-3.10-59633abf34e2f44b8e772a2c12a92132aa7c2220.tar.gz linux-3.10-59633abf34e2f44b8e772a2c12a92132aa7c2220.tar.bz2 linux-3.10-59633abf34e2f44b8e772a2c12a92132aa7c2220.zip |
rbtree: optimize fetching of sibling node
When looking to fetch a node's sibling, we went through a sequence of:
- check if node is the parent's left child
- if it is, then fetch the parent's right child
This can be replaced with:
- fetch the parent's right child as an assumed sibling
- check that node is NOT the fetched child
This avoids fetching the parent's left child when node is actually
that child. Saves a bit on code size, though it doesn't seem to make
a large difference in speed.
Signed-off-by: Michel Lespinasse <walken@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: David Woodhouse <David.Woodhouse@intel.com>
Acked-by: 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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/rbtree_test.c')
0 files changed, 0 insertions, 0 deletions