From: Frederic Weisbecker <fweisbec@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>,
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 15:28:01 +0100 [thread overview]
Message-ID: <20100113142800.GC5036@nowhere> (raw)
In-Reply-To: <1263392296.4244.228.camel@laptop>
On Wed, Jan 13, 2010 at 03:18:16PM +0100, Peter Zijlstra wrote:
> On Wed, 2010-01-13 at 12:13 -0200, Arnaldo Carvalho de Melo wrote:
> > Em Wed, Jan 13, 2010 at 02:58:53PM +0100, Peter Zijlstra escreveu:
> > > 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:
> > > > > 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.
> >
> > We need it in several places in the perf tools, to present sorted results, to
> > dump the maps for debugging purposes, etc.
> >
> > But I'll go and look at each one of them to see if there is any where it
> > is used in some stupid way.
>
> Sure, but again, that's missing the point, adding that helper isn't a
> good thing. We have no 64bit division operators in Linux either, for the
> very same reason.
>
I don't understand why this is unsane. Sure it is O(n log(n)), but
that's what is suitable for our use in perf. Shouldn't we simplify
it through a helper just because it's not something sane in most
other cases?
But yeah, such helper inside the kernel wouldn't be sane, as it
wouldn't fit any sane need I guess.
next prev parent reply other threads:[~2010-01-13 14:28 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
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 [this message]
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=20100113142800.GC5036@nowhere \
--to=fweisbec@gmail.com \
--cc=acme@infradead.org \
--cc=efault@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
--cc=peterz@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.