Re: [PATCH v1 2/2] x86, perf,cqm: handle CPU hotplug

Thomas Gleixner
2015-06-18T20:09:45Z

On Thu, 18 Jun 2015, Dave Hansen wrote:
> On 06/18/2015 12:47 PM, Thomas Gleixner wrote:
> >> > @@ -1239,12 +1239,15 @@ static inline void cqm_pick_event_reader(int cpu)
> >> > int phys_id = topology_physical_package_id(cpu);
> >> > int i;
> >> >
> >> > + mutex_lock(&cache_mutex);
> > I already explained it to Vikas. You CANNOT take a mutex in that code
> > path as it runs with interrupts disabled on a CPU which cannot
> > schedule.
>
> How did lockdep not blow up and scream about this?

Dunno. I did not test that stuff.

The might_sleep() in mutex_lock() should catch it as well, IF that
code was ever executed AFTER boot on a running system.

Thanks,

tglx