mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Uladzislau Rezki <urezki@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Michel Lespinasse <walken@google.com>,
	Davidlohr Bueso <dave@stgolabs.net>,
	Peter Zijlstra <peterz@infradead.org>,
	David Howells <dhowells@redhat.com>,
	"Uladzislau Rezki (Sony)" <urezki@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 2/3] augmented rbtree: add new RB_DECLARE_CALLBACKS_MAX macro
Date: Mon, 29 Jul 2019 12:14:54 +0200	[thread overview]
Message-ID: <20190729101454.jd6ej2nrlyigjqs4@pc636> (raw)
In-Reply-To: <20190726184419.37adea1e227fc793c32427be@linux-foundation.org>

> 
> --- 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

  parent reply	other threads:[~2019-07-29 10:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-03  4:01 [PATCH v3 0/3] make RB_DECLARE_CALLBACKS more generic Michel Lespinasse
2019-07-03  4:01 ` [PATCH v3 1/3] augmented rbtree: add comments for RB_DECLARE_CALLBACKS macro Michel Lespinasse
2019-07-03  4:01 ` [PATCH v3 2/3] augmented rbtree: add new RB_DECLARE_CALLBACKS_MAX macro Michel Lespinasse
2019-07-08 12:24   ` Michel Lespinasse
2019-07-27  1:44     ` Andrew Morton
2019-07-27  2:20       ` Michel Lespinasse
2019-07-29 10:14       ` Uladzislau Rezki [this message]
2019-07-30  7:31         ` Michel Lespinasse
2019-07-31 14:20           ` Uladzislau Rezki
2019-07-29 10:02     ` Uladzislau Rezki
2019-07-03  4:01 ` [PATCH v3 3/3] augmented rbtree: rework the RB_DECLARE_CALLBACKS macro definition Michel Lespinasse
2019-07-03  7:22 ` [PATCH v3 0/3] make RB_DECLARE_CALLBACKS more generic Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190729101454.jd6ej2nrlyigjqs4@pc636 \
    --to=urezki@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=dave@stgolabs.net \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=walken@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®