[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v6 07/16 RESEND] rbtree: adjust node color in __rb_erase_color() only when necessary
>>> On 21.11.17 at 16:20, <kpraveen.lkml@xxxxxxxxx> wrote: > From: Michel Lespinasse <walken@xxxxxxxxxx> > > In __rb_erase_color(), we were always setting a node to black after > exiting the main loop. And in one case, after fixing up the tree to > satisfy all rbtree invariants, we were setting the current node to root > just to guarantee a loop exit, at which point the root would be set to > black. However this is not necessary, as the root of an rbtree is already > known to be black. The only case where the color flip is required is when > we exit the loop due to the current node being red, and it's easiest to > just do the flip at that point instead of doing it after the loop. > > [adrian.hunter@xxxxxxxxx: perf tools: fix build for another rbtree.c change] > Signed-off-by: Michel Lespinasse <walken@xxxxxxxxxx> > Cc: Andrea Arcangeli <aarcange@xxxxxxxxxx> > Acked-by: David Woodhouse <David.Woodhouse@xxxxxxxxx> > Cc: Rik van Riel <riel@xxxxxxxxxx> > Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx> > Cc: Daniel Santos <daniel.santos@xxxxxxxxx> > Cc: Jens Axboe <axboe@xxxxxxxxx> > Cc: "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx> > Signed-off-by: Adrian Hunter <adrian.hunter@xxxxxxxxx> > Cc: Alexander Shishkin <alexander.shishkin@xxxxxxxxx> > Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> > Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> > [Linux commit d6ff1273928ebf15466a85b7e1810cd00e72998b] > > Ported only rbtree.c to Xen. > > Signed-off-by: Praveen Kumar <kpraveen.lkml@xxxxxxxxx> Acked-by: Jan Beulich <jbeulich@xxxxxxxx> _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |