[Intel-gfx] [PATCH 2/2] drm/i915/pmu: Remove conditional HOTPLUG_CPU registration

Chris Wilson chris at chris-wilson.co.uk
Thu Nov 23 07:40:31 UTC 2017


Quoting Tvrtko Ursulin (2017-11-23 07:36:35)
> 
> On 22/11/2017 18:26, Chris Wilson wrote:
> > Even for static CPU configurations, the hotplug CPU framework is still
> > used to determine the CPU topology, and is still being used by the perf
> > event register to check for valid CPUs.
> > 
> > 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 | 8 +-------
> >   1 file changed, 1 insertion(+), 7 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c
> > index 64e36d72e76a..f1e932a3fb85 100644
> > --- a/drivers/gpu/drm/i915/i915_pmu.c
> > +++ b/drivers/gpu/drm/i915/i915_pmu.c
> > @@ -40,7 +40,7 @@
> >   
> >   #define ENGINE_SAMPLE_BITS (1 << I915_PMU_SAMPLE_BITS)
> >   
> > -static cpumask_t i915_pmu_cpumask = CPU_MASK_NONE;
> > +static cpumask_t i915_pmu_cpumask;
> >   
> >   static u8 engine_config_sample(u64 config)
> >   {
> > @@ -742,7 +742,6 @@ static const struct attribute_group *i915_pmu_attr_groups[] = {
> >       NULL
> >   };
> >   
> > -#ifdef CONFIG_HOTPLUG_CPU
> >   static int i915_pmu_cpu_online(unsigned int cpu, struct hlist_node *node)
> >   {
> >       struct i915_pmu *pmu = hlist_entry_safe(node, typeof(*pmu), node);
> > @@ -779,11 +778,9 @@ static int i915_pmu_cpu_offline(unsigned int cpu, struct hlist_node *node)
> >   }
> >   
> >   static enum cpuhp_state cpuhp_slot = CPUHP_INVALID;
> > -#endif
> >   
> >   static int i915_pmu_register_cpuhp_state(struct drm_i915_private *i915)
> >   {
> > -#ifdef CONFIG_HOTPLUG_CPU
> >       enum cpuhp_state slot;
> >       int ret;
> >   
> > @@ -802,17 +799,14 @@ static int i915_pmu_register_cpuhp_state(struct drm_i915_private *i915)
> >       }
> >   
> >       cpuhp_slot = slot;
> > -#endif
> >       return 0;
> >   }
> >   
> >   static void i915_pmu_unregister_cpuhp_state(struct drm_i915_private *i915)
> >   {
> > -#ifdef CONFIG_HOTPLUG_CPU
> >       WARN_ON(cpuhp_slot == CPUHP_INVALID);
> >       WARN_ON(cpuhp_state_remove_instance(cpuhp_slot, &i915->pmu.node));
> >       cpuhp_remove_multi_state(cpuhp_slot);
> > -#endif
> >   }
> >   
> >   void i915_pmu_register(struct drm_i915_private *i915)
> > 
> 
> You are saying CPU hotplug events are firing with CONFIG_HOTPLUG_CPU=n?

Yes. Both in practice and copying from other perf pmus.
-Chris


More information about the Intel-gfx mailing list