Re: [Patch v2 1/2] lib/rbtree: set successor's parent unconditionally

From: Peter Zijlstra
Date: Mon Oct 28 2019 - 05:21:05 EST


On Mon, Oct 28, 2019 at 10:14:41AM +0800, Wei Yang wrote:
> Both in Case 2 and 3, we exchange n and s. This mean no matter whether
> child2 is NULL or not, successor's parent should be assigned to node's.
>
> This patch takes this step out to make it explicit and reduce the
> ambiguity.
>
> Besides, this step reduces some symbol size like rb_erase().
>
> KERN_CONFIG upstream patched
> OPT_FOR_PERF 877 870
> OPT_FOR_SIZE 635 621
>
> Signed-off-by: Wei Yang <richardw.yang@xxxxxxxxxxxxxxx>

Acked-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>