From: Ingo Molnar on 21 May 2010 07:00 * Ingo Molnar <mingo(a)elte.hu> wrote: > > * Peter Zijlstra <peterz(a)infradead.org> wrote: > > > On Fri, 2010-05-21 at 12:13 +0200, Frederic Weisbecker wrote: > > > > What exactly is the puzzlement about? > > > > > The fact we use the hlist API not for hlist purpose > > > but for a list. > > > > I might miss the confusion, but hlist _are_ lists. Its > > just that their structure is slightly different that > > the regular struct list_head stuff. > > Using an API in such a mixed way may cause puzzlement > ;-) I take that back - it's clear from the function prototype that we are using a mixed API: (hlist,list). Sorry, Ingo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Steven Rostedt on 21 May 2010 10:10 On Fri, 2010-05-21 at 11:02 +0200, Peter Zijlstra wrote: > plain text document attachment (perf-trace-per-cpu-fold.patch) > Avoid the swevent hash-table by using per-tracepoint hlists. > > 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. > > -void perf_trace_disable(int event_id) > +void perf_trace_destroy(struct perf_event *p_event) > { > - struct ftrace_event_call *event; > + struct ftrace_event_call *tp_event = p_event->tp_event; > + int i; > > - mutex_lock(&event_mutex); > - list_for_each_entry(event, &ftrace_events, list) { > - if (event->id == event_id) { > - perf_trace_event_disable(event); > - module_put(event->mod); > - break; > + if (--tp_event->perf_refcount > 0) > + return; > + You remove the event_mutex and then update the tp_event->perf_refcount without any protection. That tp_event->perf_refcount is global to the event not to the perf event. -- Steve > + tp_event->perf_event_disable(tp_event); > + > + free_percpu(tp_event->perf_events); > + tp_event->perf_events = NULL; > + > + if (!--total_ref_count) { > + for (i = 0; i < 4; i++) { > + free_percpu(perf_trace_buf[i]); > + perf_trace_buf[i] = NULL; > } > } > - mutex_unlock(&event_mutex); > } > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
First
|
Prev
|
Pages: 1 2 Prev: cfq-iosched: remove dead_key from cfq_io_context Next: misc: don't use sig->count |