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]
Message-ID: <20100310203338.GA9737@nowhere>
Date:	Wed, 10 Mar 2010 21:33:41 +0100
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	LKML <linux-kernel@...r.kernel.org>, Ingo Molnar <mingo@...e.hu>,
	Paul Mackerras <paulus@...ba.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	Masami Hiramatsu <mhiramat@...hat.com>,
	Jason Baron <jbaron@...hat.com>,
	Arnaldo Carvalho de Melo <acme@...hat.com>
Subject: Re: [RFC PATCH] perf: Store relevant events in a hlist

On Wed, Mar 10, 2010 at 08:34:52PM +0100, Peter Zijlstra wrote:
> I'm not quite sure why you need the node thing, you already have a
> hash-bucket to iterate, simply stick all events into the one bucket and
> walk through it with a filter and process all events that match.


This inter level of indirection was one of my heaviest hesitations.
In case we have a hash collision, I just wanted to ensure we keep
an amortized O(n) in any case, that at the cost of this level of
indirection. Plus that removed the config:id check in every events,
as the check is made only once.

That said I guess we can indeed remove that and have the events
directly in the hash bucket. Assuming we deal well to avoid
collisions, it should be fine.

 
> As to all those for_each_online_cpu() thingies, it might make sense to
> also have a global hash-table for events active on all cpus,... hmm was
> that the reason for the node thing, one event cannot be in multiple
> buckets?


There are several reasons I've made it per cpu.
Assuming we have a global hash table for wide events, it means we'll
have some cache dance each time an event is disabled/enabled (which
is quite often as wide events are per task, even worst if the initial task
has numerous threads that have this event duplicated). Also, as wide
events mean per task, the event will always be active in one cpu at
a time, it would be wasteful to check it on other cpus.

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