Messages in this thread | | | Date | Thu, 7 Jan 2016 14:40:08 +0100 | From | Peter Zijlstra <> | Subject | Re: [tip:perf/core] perf: Fix race in perf_event_exec() |
| |
On Wed, Jan 06, 2016 at 01:56:56PM -0500, Eric Dumazet wrote: > On Wed, Jan 6, 2016 at 1:46 PM, tip-bot for Peter Zijlstra > <tipbot@zytor.com> wrote: > > > > > This is because context switches can swap the task_struct::perf_event_ctxp[] > > pointer around. Therefore you have to either disable preemption when looking > > at current, or hold ctx->lock. > > > > > > > > void perf_event_exec(void) > > { > > - struct perf_event_context *ctx; > > int ctxn; > > > > rcu_read_lock(); > > Do we still need this rcu_read_lock(), if perf_event_enable_on_exec() > uses local_irq_save( ?
Strictly speaking we should not rely on the fact that RCU grace periods do not progress with IRQs disabled, so yes.
| |