Re: [PATCH 4/7] perf: Check if HT is supported and enabled

From: Stephane Eranian
Date: Tue Jan 04 2011 - 08:52:43 EST


On Tue, Jan 4, 2011 at 2:44 PM, Peter Zijlstra <a.p.zijlstra@xxxxxxxxx> wrote:
> On Tue, 2011-01-04 at 14:38 +0100, Stephane Eranian wrote:
>> My solution at the time (2.6.30) was to do:
>> Â Â Â Â ht_enabled = cpumask_weight(__get_cpu_var(cpu_sibling_map)) > 1;
>
> Won't that report a machine a HT disabled when you offline a sibling?

I think you're right. I was not dealing with hotplug CPU.

> Which kinda defeats the purpose of our usage here, since we need to know
> it before either sibling comes online.

Then, it seems the only hope is to peek at a MSR that reports the BIOS setting.
But I don't know which one it is.

Couldn't you simply over-provision, and then when the CPU is online, use my
ht_enabled statement to figure out whether or not you need to handle the sharing
issue?
--
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/