From: Peter Zijlstra <peterz@infradead.org>
To: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@elte.hu>,
linux-kernel@vger.kernel.org, Mike Galbraith <efault@gmx.de>,
Paul Mackerras <paulus@samba.org>
Subject: Re: [PATCH 1/3] rbtree: Introduce rb_for_each_entry
Date: Wed, 13 Jan 2010 14:58:53 +0100 [thread overview]
Message-ID: <1263391133.4244.226.camel@laptop> (raw)
In-Reply-To: <20100113135205.GC5576@ghostprotocols.net>
On Wed, 2010-01-13 at 11:52 -0200, Arnaldo Carvalho de Melo wrote:
> Em Wed, Jan 13, 2010 at 02:34:45PM +0100, Frederic Weisbecker escreveu:
> > On Wed, Jan 13, 2010 at 02:16:09PM +0100, Peter Zijlstra wrote:
> > > On Wed, 2010-01-13 at 11:01 -0200, Arnaldo Carvalho de Melo wrote:
> > > > From: Arnaldo Carvalho de Melo <acme@redhat.com>
> > > >
> > > > Similar to list_for_each_entry, helps reducing boilerplate in many
> > > > places and makes rbtrees closer to list.h macros.
> > > >
> > > > First conversion will be in the tools/perf.
> > >
> > > I'm still not sure you really want to do this, it might give people the
> > > impression its a sane thing to do ;-)
> >
> > At least it matches many patterns in perf :)
>
> What an insane piece of... software! 8-) Whatever, if it makes Peter
> happy we can keep it on tools/perf/util/include/linux/rbtree.h, just
> after the:
>
> #include "../../../../include/linux/rbtree.h"
>
> ;-)
>
> Just like we have list_del_range() in tools/perf/util/include/linux/list.h.
That's not the point, doing a for_each on the rb-trees as we have today
is a O(n log(n)) operation, not something you should want to do often.
Adding a helper promotes the idea that its a sane thing to do, its not.
If you really need it, open coding it isn't hard, but the lack of helper
does make you think and hopefully realize you're doing something funny.
next prev parent reply other threads:[~2010-01-13 13:59 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-13 13:01 [PATCH 1/3] rbtree: Introduce rb_for_each_entry Arnaldo Carvalho de Melo
2010-01-13 13:01 ` [PATCH 2/3] perf tools: Use rb_for_each_entry Arnaldo Carvalho de Melo
2010-01-13 13:01 ` [PATCH 3/3] perf tools: Encode kernel module mappings in perf.data Arnaldo Carvalho de Melo
2010-01-13 13:16 ` [PATCH 1/3] rbtree: Introduce rb_for_each_entry Peter Zijlstra
2010-01-13 13:34 ` Frederic Weisbecker
2010-01-13 13:36 ` Peter Zijlstra
2010-01-13 13:52 ` Arnaldo Carvalho de Melo
2010-01-13 13:58 ` Peter Zijlstra [this message]
2010-01-13 14:13 ` Arnaldo Carvalho de Melo
2010-01-13 14:18 ` Peter Zijlstra
2010-01-13 14:22 ` Arnaldo Carvalho de Melo
2010-01-13 14:28 ` Frederic Weisbecker
2010-01-13 15:26 ` Arnaldo Carvalho de Melo
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=1263391133.4244.226.camel@laptop \
--to=peterz@infradead.org \
--cc=acme@infradead.org \
--cc=efault@gmx.de \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
/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