[Intel-gfx] [PATCH 1/2] drm/i915/pmu: Limit the selection of the dedicated reader cpu to an online sibling

Chris Wilson chris at chris-wilson.co.uk
Wed Nov 22 18:26:26 UTC 2017


When bringing a cpu online, we want to see if it or a sibling is already
in the online mask before adding to the designated reader.

Fixes: b46a33e271ed ("drm/i915/pmu: Expose a PMU interface for perf queries")
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Cc: Dmitry Rogozhkin <dmitry.v.rogozhkin at intel.com>
---
 drivers/gpu/drm/i915/i915_pmu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c
index 1071935bfa67..64e36d72e76a 100644
--- a/drivers/gpu/drm/i915/i915_pmu.c
+++ b/drivers/gpu/drm/i915/i915_pmu.c
@@ -750,7 +750,8 @@ static int i915_pmu_cpu_online(unsigned int cpu, struct hlist_node *node)
 
 	GEM_BUG_ON(!pmu->base.event_init);
 
-	target = cpumask_any_and(&i915_pmu_cpumask, &i915_pmu_cpumask);
+	target = cpumask_any_and(&i915_pmu_cpumask,
+				 topology_sibling_cpumask(cpu));
 	/* Select the first online CPU as a designated reader. */
 	if (target >= nr_cpu_ids)
 		cpumask_set_cpu(cpu, &i915_pmu_cpumask);
-- 
2.15.0



More information about the Intel-gfx mailing list