The patch titled Subject: lib/rbtree: set successor's parent unconditionally has been added to the -mm tree. Its filename is lib-rbtree-set-successors-parent-unconditionally.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/lib-rbtree-set-successors-parent-unconditionally.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/lib-rbtree-set-successors-parent-unconditionally.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Wei Yang <richardw.yang@xxxxxxxxxxxxxxx> Subject: lib/rbtree: set successor's parent unconditionally 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 Link: http://lkml.kernel.org/r/20191028021442.5450-1-richardw.yang@xxxxxxxxxxxxxxx Signed-off-by: Wei Yang <richardw.yang@xxxxxxxxxxxxxxx> Acked-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx> Reviewed-by: Michel Lespinasse <walken@xxxxxxxxxx> Cc: Davidlohr Bueso <dave@xxxxxxxxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/rbtree_augmented.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/include/linux/rbtree_augmented.h~lib-rbtree-set-successors-parent-unconditionally +++ a/include/linux/rbtree_augmented.h @@ -283,14 +283,13 @@ __rb_erase_augmented(struct rb_node *nod __rb_change_child(node, successor, tmp, root); if (child2) { - successor->__rb_parent_color = pc; rb_set_parent_color(child2, parent, RB_BLACK); rebalance = NULL; } else { unsigned long pc2 = successor->__rb_parent_color; - successor->__rb_parent_color = pc; rebalance = __rb_is_black(pc2) ? parent : NULL; } + successor->__rb_parent_color = pc; tmp = successor; } _ Patches currently in -mm which might be from richardw.yang@xxxxxxxxxxxxxxx are mm-mmapc-remove-a-never-trigger-warning-in-__vma_adjust.patch mm-mmapc-prev-could-be-retrieved-from-vma-vm_prev.patch mm-mmapc-__vma_unlink_prev-is-not-necessary-now.patch mm-mmapc-extract-__vma_unlink_list-as-counter-part-for-__vma_link_list.patch mm-mmapc-rb_parent-is-not-necessary-in-__vma_link_list.patch mm-rmapc-dont-reuse-anon_vma-if-we-just-want-a-copy.patch mm-rmapc-reuse-mergeable-anon_vma-as-parent-when-fork.patch hugetlb-remove-unused-hstate-in-hugetlb_fault_mutex_hash.patch mm-mmapc-make-vma_merge-comment-more-easy-to-understand.patch userfaultfd-use-vma_pagesize-for-all-huge-page-size-calculation.patch userfaultfd-remove-unnecessary-warn_on-in-__mcopy_atomic_hugetlb.patch userfaultfd-wrap-the-common-dst_vma-check-into-an-inlined-function.patch mm-fix-typo-in-the-comment-when-calling-function-__setpageuptodate.patch lib-rbtree-set-successors-parent-unconditionally.patch lib-rbtree-get-successors-color-directly.patch