>>> On 21.11.17 at 16:19, <[email protected]> wrote: > From: Michel Lespinasse <[email protected]> > > - Use the newly introduced rb_set_parent_color() function to flip the color > of nodes whose parent is already known. > - Optimize rb_parent() when the node is known to be red - there is no need > to mask out the color in that case. > - Flipping gparent's color to red requires us to fetch its rb_parent_color > field, so we can reuse it as the parent value for the next loop iteration. > - Do not use __rb_rotate_left() and __rb_rotate_right() to handle tree > rotations: we already have pointers to all relevant nodes, and know their > colors (either because we want to adjust it, or because we've tested it, > or we can deduce it as black due to the node proximity to a known red > node). > So we can generate more efficient code by making use of the node pointers > we already have, and setting both the parent and color attributes for > nodes all at once. Also in Case 2, some node attributes don't have to > be set because we know another tree rotation (Case 3) will always follow > and override them. > > Signed-off-by: Michel Lespinasse <[email protected]> > Cc: Andrea Arcangeli <[email protected]> > Acked-by: David Woodhouse <[email protected]> > Cc: Rik van Riel <[email protected]> > Cc: Peter Zijlstra <[email protected]> > Cc: Daniel Santos <[email protected]> > Cc: Jens Axboe <[email protected]> > Cc: "Eric W. Biederman" <[email protected]> > Signed-off-by: Andrew Morton <[email protected]> > Signed-off-by: Linus Torvalds <[email protected]> > [Linux commit 5bc9188aa207dafd47eab57df7c4fe5b3d3f636a] > > Ported to Xen. > > Signed-off-by: Praveen Kumar <[email protected]>
Acked-by: Jan Beulich <[email protected]> _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
