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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Stephane Eranian
Date: Tuesday, January 4, 2011 - 6:38 am

Hi,

I had to deal with this issue with perfmon back in 2.6.30 and earlier kernels.
I remember that I was surprised not to find any easy helper function to figure
this out back then. Being HT capable is different from having HT enabled.
Seems like the situation has not improved since then.

My solution at the time (2.6.30) was to do:
        ht_enabled = cpumask_weight(__get_cpu_var(cpu_sibling_map)) > 1;

Not too convinced the per-cpu variable is necessary because I don't
know of a BIOS that would allow you to turn on HT on only some of the
cores (AFAIK, this is an all or nothing feature).


On Tue, Jan 4, 2011 at 12:10 PM, Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 4/7] perf: Check if HT is supported and enabled, H. Peter Anvin, (Mon Jan 3, 12:53 pm)
Re: [PATCH 4/7] perf: Check if HT is supported and enabled, Stephane Eranian, (Tue Jan 4, 6:38 am)
Re: [PATCH 4/7] perf: Check if HT is supported and enabled, Stephane Eranian, (Tue Jan 4, 6:52 am)
Re: [PATCH 4/7] perf: Check if HT is supported and enabled, Stephane Eranian, (Tue Jan 4, 8:35 am)
Re: [PATCH 4/7] perf: Check if HT is supported and enabled, Valdis.Kletnieks, (Tue Jan 4, 11:55 am)
Re: [PATCH 4/7] perf: Check if HT is supported and enabled, H. Peter Anvin, (Tue Jan 4, 12:00 pm)