Re: [RFC PATCH 3/8] perf: Init/fini PMU specific data

From: Peter Zijlstra
Date: Mon Dec 02 2019 - 11:43:33 EST


On Mon, Dec 02, 2019 at 07:38:00PM +0300, Alexey Budankov wrote:
>
> On 02.12.2019 17:59, Andi Kleen wrote:
> >>
> >> This is atricous crap. Also it is completely broken for -RT.
> >
> > Well can you please suggest how you would implement it instead?
>
> FWIW,
> An alternative could probably be to make task_ctx_data allocations
> on the nearest context switch in, and obvious drawback is slowdown on
> this critical path, but it could be amortized by static branches.

Context switch is under a raw_spinlock_t too.