Re: [PATCH 2/5] perf: generic intel uncore support

From: Peter Zijlstra
Date: Mon Apr 02 2012 - 18:24:40 EST


On Sun, 2012-04-01 at 11:11 +0800, Yan, Zheng wrote:
>
> >> +static int __init uncore_type_init(struct intel_uncore_type *type)
> >> +{
> >> + struct intel_uncore_pmu *pmus;
> >> + struct attribute_group *events_group;
> >> + struct attribute **attrs;
> >> + int i, j;
> >> +
> >> + pmus = kzalloc(sizeof(*pmus) * type->num_boxes, GFP_KERNEL);
> >> + if (!pmus)
> >> + return -ENOMEM;
> >
> > Hmm, but if you have a pmu per number of boxes, then what do you need
> > that pmu->box reference for?
>
> Type->num_boxes is number of boxes within one physical cpu. pmu->box_hash
> is needed because there can be several physical cpus in a system.

Ah, indeed.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/