lkml.org 
[lkml]   [2019]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v3 2/3] augmented rbtree: add new RB_DECLARE_CALLBACKS_MAX macro
> 
> --- a/lib/rbtree_test.c~augmented-rbtree-add-new-rb_declare_callbacks_max-macro-fix-2
> +++ a/lib/rbtree_test.c
> @@ -220,10 +220,6 @@ static void check_augmented(int nr_nodes
> struct rb_node *rb;
>
> 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));
> - }
> }
>
I have a question here it is a bit out of this topic but still related :)

Can we move "check augmented" functionality to the rbtree_augmented.h
header file making it public?

I am asking because many users might need it, i mean to check that the
tree is correctly augmented and is correctly maintained. For example
in vmalloc i have my own implementation:

<snip>
#if DEBUG_AUGMENT_PROPAGATE_CHECK
static void
augment_tree_propagate_check(struct rb_node *n)
{
...
}
<snip>

in order to debug and check that nodes are augmented correctly across
the tree.

Thank you.

--
Vlad Rezki

\
 
 \ /
  Last update: 2019-07-29 12:15    [W:0.066 / U:14.344 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site