On Wed, Mar 10, 2021 at 08:37:52AM -0800, kan.li...@linux.intel.com wrote:
> @@ -4420,6 +4513,27 @@ void intel_cpuc_finish(struct cpu_hw_events *cpuc)
>  static void intel_pmu_cpu_dead(int cpu)
>  {
>       intel_cpuc_finish(&per_cpu(cpu_hw_events, cpu));
> +
> +     if (is_hybrid()) {
> +             struct cpu_hw_events *cpuc = &per_cpu(cpu_hw_events, cpu);
> +             struct x86_hybrid_pmu *hybrid_pmu = NULL;
> +             int i;
> +
> +             for (i = 0; i < x86_pmu.num_hybrid_pmus; i++) {
> +                     if (cpumask_test_and_clear_cpu(cpu, 
> &x86_pmu.hybrid_pmu[i].supported_cpus)) {
> +                             hybrid_pmu = &x86_pmu.hybrid_pmu[i];
> +                             break;
> +                     }
> +             }
> +             if (WARN_ON_ONCE(!hybrid_pmu))
> +                     return;
> +
> +             cpuc->pmu = NULL;
> +             if (cpumask_empty(&hybrid_pmu->supported_cpus)) {
> +                     perf_pmu_unregister(&hybrid_pmu->pmu);
> +                     hybrid_pmu->pmu.type = -1;
> +             }
> +     }
>  }

CPU_DEAD is the part of hotplug after we've disabled IRQs for the last
time and before we kill ourselves, and you're trying to use mutexes
again!

Reply via email to