lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 13 Jan 2010 14:58:53 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Arnaldo Carvalho de Melo <acme@...radead.org>
Cc:	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...e.hu>, linux-kernel@...r.kernel.org,
	Mike Galbraith <efault@....de>,
	Paul Mackerras <paulus@...ba.org>
Subject: Re: [PATCH 1/3] rbtree: Introduce rb_for_each_entry

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@...hat.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.



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ