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  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, 30 Aug 2017 13:30:26 +0300
From:   Alexey Budankov <alexey.budankov@...ux.intel.com>
To:     Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Peter Zijlstra <peterz@...radead.org>
Cc:     Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Andi Kleen <ak@...ux.intel.com>,
        Kan Liang <kan.liang@...el.com>,
        Dmitri Prokhorov <Dmitry.Prohorov@...el.com>,
        Valery Cherepennikov <valery.cherepennikov@...el.com>,
        Mark Rutland <mark.rutland@....com>,
        Stephane Eranian <eranian@...gle.com>,
        David Carrillo-Cisneros <davidcc@...gle.com>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v6 1/3] perf/core: use rb trees for pinned/flexible groups

On 30.08.2017 13:18, Alexander Shishkin wrote:
> Alexey Budankov <alexey.budankov@...ux.intel.com> writes:
> 
>>>> Iterating cpu specific subtree like this:
>>>>
>>>> #define for_each_group_event(event, group, cpu, pmu, field)	 \
>>>> 	for (event = rb_entry_safe(group_first(group, cpu, pmu), \
>>>> 				   typeof(*event), field);	 \
>>>> 	     event && event->cpu == cpu && event->pmu == pmu;	 \
>>>> 	     event = rb_entry_safe(rb_next(&event->field),	 \
>>>> 				   typeof(*event), field))
>>>
>>> Afaict, this assumes that you are also ordering on event->pmu, which
>>> should be reflected in your _less function. And also assuming that
>>> group_first() is doing the right thing. Can we see the code?
>>
>> I didn't do ordering by PMU for this patch set. Yet more I implemented 
>> groups_first() like this:
> 
> Your iterator (quoted above) begs to differ.

What do you specifically mean? I am doing iterations like this:

/*
 * Iterate event groups thru the whole tree.
 */
#define perf_event_groups_for_each(event, groups, node)			\
	for (event = rb_entry_safe(rb_first(&((groups)->tree)),		\
			typeof(*event), node); event; 			\
			event = rb_entry_safe(rb_next(&event->node),	\
				typeof(*event), node))

/*
 * Iterate event groups with cpu == cpu_id.
 */
#define perf_event_groups_for_each_cpu(event, key, groups, node)	\
	for (event = perf_event_groups_first(groups, key);		\
		event && event->cpu == key;				\
		event = rb_entry_safe(rb_next(&event->node),		\
				typeof(*event), node))

> 
> Regards,
> --
> Alex
> 

Thanks,
Alexey

Powered by blists - more mailing lists