+ augmented-rbtree-add-new-rb_declare_callbacks_max-macro-fix-3.patch added to -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 added to the -mm tree.  Its filename is
     augmented-rbtree-add-new-rb_declare_callbacks_max-macro-fix-3.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/augmented-rbtree-add-new-rb_declare_callbacks_max-macro-fix-3.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/augmented-rbtree-add-new-rb_declare_callbacks_max-macro-fix-3.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: 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>
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-add-new-rb_declare_callbacks_max-macro-fix.patch
augmented-rbtree-add-new-rb_declare_callbacks_max-macro-fix-3.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