Unverified Commit c6172f7a authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!15750 perf/core: Fix pmus_lock vs. pmus_srcu ordering

parents edd60495 1239cab7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -11670,6 +11670,8 @@ void perf_pmu_unregister(struct pmu *pmu)
{
	mutex_lock(&pmus_lock);
	list_del_rcu(&pmu->entry);
	idr_remove(&pmu_idr, pmu->type);
	mutex_unlock(&pmus_lock);

	/*
	 * We dereference the pmu list under both SRCU and regular RCU, so
@@ -11679,7 +11681,6 @@ void perf_pmu_unregister(struct pmu *pmu)
	synchronize_rcu();

	free_percpu(pmu->pmu_disable_count);
	idr_remove(&pmu_idr, pmu->type);
	if (pmu_bus_running && pmu->dev && pmu->dev != PMU_NULL_DEV) {
		if (pmu->nr_addr_filters)
			device_remove_file(pmu->dev, &dev_attr_nr_addr_filters);
@@ -11687,7 +11688,6 @@ void perf_pmu_unregister(struct pmu *pmu)
		put_device(pmu->dev);
	}
	free_pmu_context(pmu);
	mutex_unlock(&pmus_lock);
}
EXPORT_SYMBOL_GPL(perf_pmu_unregister);