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: <1274436125.1674.1690.camel@laptop>
Date:	Fri, 21 May 2010 12:02:05 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Frederic Weisbecker <fweisbec@...il.com>
Cc:	Ingo Molnar <mingo@...e.hu>, Paul Mackerras <paulus@...ba.org>,
	Arnaldo Carvalho de Melo <acme@...radead.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 02/10] perf, trace: Use per-tracepoint-per-cpu hlist to
 track events

On Fri, 2010-05-21 at 11:40 +0200, Frederic Weisbecker wrote:
> On Fri, May 21, 2010 at 11:02:03AM +0200, Peter Zijlstra wrote:

> > Also, avoid conditionals on the fast path by ordering with probe unregister
> > so that we should never get on the callback path without the data being there.
> > 
> 									\
> > +	head = per_cpu_ptr(event_call->perf_events, smp_processor_id());\

> Should be rcu_dereference_sched ?

No, I removed all that rcu stuff and synchronized against the probe
unregister.

I assumed that after probe unregister a tracepoint callback doesn't
happen, which then guarantees we should never get !head.

> > +	for_each_possible_cpu(cpu)
> > +		INIT_HLIST_HEAD(per_cpu_ptr(list, cpu));
> > +
> > +	tp_event->perf_events = list;
> 
> 
> 
> I suspect this must be rcu_assign_pointer.

Same thing as above, I do this before probe register, so I see no need
for RCU.

> > +	list = per_cpu_ptr(list, smp_processor_id());
> > +	hlist_add_head_rcu(&p_event->hlist_entry, list);
> 
> 
> 
> Ah and may be small comment, because using the hlist api here
> may puzzle more people than just me ;)

What exactly is the puzzlement about?

> > +	if (--tp_event->perf_refcount > 0)
> > +		return;
> > +
> > +	tp_event->perf_event_disable(tp_event);
> 
> 
> 
> Don't we need a rcu_synchronize_sched() here?

Doesn't probe unregister synchronize things against its own callback?

> > +	free_percpu(tp_event->perf_events);
> > +	tp_event->perf_events = NULL;
> 
> 
> 
> And rcu_assign?

Which again, makes any use of RCU unneeded.


> > +	raw_data = per_cpu_ptr(perf_trace_buf[*rctxp], smp_processor_id());
> 
> 
> 
> Needs rcu_dereference_sched too. And this could be __this_cpu_var()

Ahh! so that is what its called.

> > +	preempt_disable_notrace();
> 
> 
> Why is this needed. We have the recursion context protection already.

Because:

@@ -4094,7 +4087,7 @@ end:
 
 int perf_swevent_get_recursion_context(void)
 {
-       struct perf_cpu_context *cpuctx = &get_cpu_var(perf_cpu_context);
+       struct perf_cpu_context *cpuctx = &__get_cpu_var(perf_cpu_context);
        int rctx;
 
        if (in_nmi())

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