drm/i915/pmu: Only allow running on a single CPU
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>
Thu, 23 Nov 2017 12:34:32 +0000 (12:34 +0000)
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>
Fri, 24 Nov 2017 09:54:43 +0000 (09:54 +0000)
commit0426c046546140fc42db5addeb7e2298dd0b6fb1
treebf43ad8a650fadd6bc700bdb01c146084d2eb1ef
parent141a0895d5ad3d2540c3d08651f2b63443fb8dfd
drm/i915/pmu: Only allow running on a single CPU

We do two things, both of which are purely to simplify and clarify the
implementation:

1.

Simplify the CPU online callback so it is more obvious that the purpose
there is to set a single CPU mask bit for the first CPU which comes
online. Using cpumask_weight for this reads more obvious than the trick
with cpumask_and_any.

2.

Modify the event init so that events can be created only on a single CPU.

This removes looking at the requested CPU thread siblings, and only allows
creating on the current active CPU.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
Tested-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20171123123432.25035-2-tvrtko.ursulin@linux.intel.com
drivers/gpu/drm/i915/i915_pmu.c