|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 02/20] lib/rbtree.c: optimize rb_erase()
On Sat, 2017-06-17 at 15:02 +0530, Praveen Kumar wrote:
> Tfour 4 redundant if-conditions in function __rb_erase_color() in
> lib/rbtree.c are removed.
>
> In pseudo-source-code, the structure of the code is as follows:
>
> if ((!A || B) && (!C || D)) {
> .
> .
> .
> } else {
> if (!C || D) {//if this is true, it implies: (A ==
> true) && (B == false)
> if (A) {//hence this always evaluates
> to 'true'...
> .
> }
> .
> //at this point, C always becomes true,
> because of:
> __rb_rotate_right/left();
> //and:
> other = parent->rb_right/left;
> }
> .
> .
> if (C) {//...and this too !
> .
> }
> }
>
> Signed-off-by: Wolfram Strepp <wstrepp@xxxxxx>
> Acked-by: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
> Cc: Andrea Arcangeli <andrea@xxxxxxxxxxxx>
> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> [Linux commit 55a63998b8967615a15e2211ba0ff3a84a565824]
>
> Ported to Xen.
>
> Signed-off-by: Praveen Kumar <kpraveen.lkml@xxxxxxxxx>
>
Reviewed-by: Dario Faggioli <dario.faggioli@xxxxxxxxxx>
Dario
--
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)Attachment:
signature.asc _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |