[folded-merged] augmented-rbtree-add-new-rb_declare_callbacks_max-macro-fix-3.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: augmented-rbtree-add-new-rb_declare_callbacks_max-macro-fix-3
has been removed from the -mm tree.  Its filename was
     augmented-rbtree-add-new-rb_declare_callbacks_max-macro-fix-3.patch

This patch was dropped because it was folded into augmented-rbtree-add-new-rb_declare_callbacks_max-macro.patch

------------------------------------------------------
From: Michel Lespinasse <walken@xxxxxxxxxx>
Subject: augmented-rbtree-add-new-rb_declare_callbacks_max-macro-fix-3

After introducing RB_DECLARE_CALLBACKS_MAX, we do not need the
augment_recompute function to recompute node->augmented during
rbtree rebalancing callbacks. However, this function was also
used in check_augmented() to verify that node->augmented was
correctly set, so we need to reintroduce the code for that check.

Link: http://lkml.kernel.org/r/20190727022027.GA86863@xxxxxxxxxx
Signed-off-by: Michel Lespinasse <walken@xxxxxxxxxx>
Cc: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
Cc: David Howells <dhowells@xxxxxxxxxx>
Cc: Davidlohr Bueso <dbueso@xxxxxxx>
Cc: Uladzislau Rezki <urezki@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 lib/rbtree_test.c |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

--- a/lib/rbtree_test.c~augmented-rbtree-add-new-rb_declare_callbacks_max-macro-fix-3
+++ a/lib/rbtree_test.c
@@ -222,7 +222,20 @@ static void check_augmented(int nr_nodes
 	check(nr_nodes);
 	for (rb = rb_first(&root.rb_root); rb; rb = rb_next(rb)) {
 		struct test_node *node = rb_entry(rb, struct test_node, rb);
-		WARN_ON_ONCE(node->augmented != augment_recompute(node));
+		u32 subtree, max = node->val;
+		if (node->rb.rb_left) {
+			subtree = rb_entry(node->rb.rb_left, struct test_node,
+					   rb)->augmented;
+			if (max < subtree)
+				max = subtree;
+		}
+		if (node->rb.rb_right) {
+			subtree = rb_entry(node->rb.rb_right, struct test_node,
+					   rb)->augmented;
+			if (max < subtree)
+				max = subtree;
+		}
+		WARN_ON_ONCE(node->augmented != max);
 	}
 }
 
_

Patches currently in -mm which might be from walken@xxxxxxxxxx are

rbtree-sync-up-the-tools-copy-of-the-code-with-the-main-one.patch
augmented-rbtree-add-comments-for-rb_declare_callbacks-macro.patch
augmented-rbtree-add-new-rb_declare_callbacks_max-macro.patch
augmented-rbtree-rework-the-rb_declare_callbacks-macro-definition.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux