[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTim4gFdxn3pHZuxXe-AwTCYrnUHHeFkEK6wisYiL@mail.gmail.com>
Date: Tue, 15 Mar 2011 22:36:18 +0800
From: Lin Ming <minggr@...il.com>
To: Frederic Weisbecker <fweisbec@...il.com>
Cc: LKML <linux-kernel@...r.kernel.org>, Ingo Molnar <mingo@...e.hu>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
Paul Mackerras <paulus@...ba.org>,
Stephane Eranian <eranian@...gle.com>,
Steven Rostedt <rostedt@...dmis.org>,
Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
Thomas Gleixner <tglx@...utronix.de>,
Hitoshi Mitake <mitake@....info.waseda.ac.jp>
Subject: Re: [RFC PATCH 1/4] perf: Starter and stopper events
On Tue, Mar 15, 2011 at 3:18 AM, Frederic Weisbecker <fweisbec@...il.com> wrote:
>
> +static void perf_event_pause_resume(struct perf_event *event, int nmi,
> + struct perf_sample_data *data,
> + struct pt_regs *regs)
> +{
> + struct perf_event *iter;
> + unsigned long flags;
> +
> + /*
> + * Ensure the targets can't be sched in/out concurrently.
> + * Disabling irqs is sufficient for that because starters/stoppers
> + * are on the same cpu/task.
> + */
> + local_irq_save(flags);
Could you explain this more detail?
> +
> +
> + /* Prevent the targets from being removed under us. */
> + rcu_read_lock();
> +
> + list_for_each_entry_rcu(iter, &event->starter_list, starter_entry) {
> + /*
> + * There is a small race window here, between the state
> + * gets set to active and the event is actually ->add().
> + * We need to find a way to ensure the starter/stopper
> + * can't trigger in between.
Can we set the state to active after the event is actually ->add()?
> + */
> + if (iter->state == PERF_EVENT_STATE_ACTIVE) {
> + if (iter->paused) {
> + iter->pmu->start(iter, PERF_EF_RELOAD);
> + iter->paused = 0;
> + }
> + }
> + }
> +
Thanks,
Lin Ming
--
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