lkml.org 
[lkml]   [2003]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: detecting hyperthreading in linux 2.4.19
Dave Jones writes:
> On Fri, Jan 10, 2003 at 08:05:07AM +0100, Mikael Pettersson wrote:
>
> > If the kernel has sched_setaffinity() or some other way of binding a process
> > to a given CPU (as numbered by the kernel, which may or may not be related
> > to any physical CPU numbers), then this will do it: execute CPUID on each
> > CPU and check the initial APIC ID field. If you find one that's non-zero,
> > then HT is enabled.
>
> That's a horrible way of reimplementing /dev/cpu/x/cpuid 8-)

True. I forgot about that interface since I personally never configure or use it.

So this answers the original question. Just access /dev/cpu/$CPU/cpuid
for all (accessible) values of $CPU.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:32    [W:0.032 / U:0.492 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site