Skip to contentSkip to conversation

Determining if the current processor is Hyperthreaded

DISCUSSION Athul Acharya 2 participants 5 messages Jul 29, 2005 – Aug 6, 2005

lore
Share & tools
lore
#0 lore raw

Hey folks,

Is there a quick way to determine if the current processor is Hyperthreaded, and if so, which logical processor represents the other thread on the chip? Please cc replies to me as I am not subscribed to the list :-)

Thanks,

Athul

#1 lore raw
Quoted 6 lines · Athul Acharya

Hey folks,

Is there a quick way to determine if the current processor is Hyperthreaded, and if so, which logical processor represents the other thread on the chip? Please cc replies to me as I am not subscribed to the list :-)

Look at /proc/cpuinfo and see if "siblings" is listed and more than one. There is no "other thread" there, it's like "which one is the other hand?"

Signature · 3 lines
   -bill davidsen ([email protected])
"The secret to procrastination is to put things off until the
 last possible moment - but no longer"  -me
#2 lore raw
Quoted 10 lines · Bill Davidsen
Quoted 6 lines · Athul Acharya

Hey folks,

Is there a quick way to determine if the current processor is Hyperthreaded, and if so, which logical processor represents the other thread on the chip? Please cc replies to me as I am not subscribed to the list :-)

Look at /proc/cpuinfo and see if "siblings" is listed and more than one. There is no "other thread" there, it's like "which one is the other hand?"

Sorry, I should've been more specific -- I mean within the kernel. That is, I want to know whether the current cpu I (kernel code) am executing on is hyperthreaded, and if so, which logical cpu represents the other thread on chip.

Athul

#3 lore raw
Quoted 3 lines · Athul Acharya

That is, I want to know whether the current cpu I (kernel code) am executing on is hyperthreaded, and if so, which logical cpu represents the other thread on chip.

Trying again, as it seems like a simple thing that really should exist
-- is_cpu_hyperthreaded(smp_processor_id()) -- or something similar. Anyone?

Athul

#4 lore raw
Quoted 8 lines · Athul Acharya
Quoted 3 lines · Athul Acharya

That is, I want to know whether the current cpu I (kernel code) am executing on is hyperthreaded, and if so, which logical cpu represents the other thread on chip.

Trying again, as it seems like a simple thing that really should exist
-- is_cpu_hyperthreaded(smp_processor_id()) -- or something similar. Anyone?

Is anyone receiving this? I should've mentioned in subsequent mails (I did in the original) that I'm not subscribed so any replies need to be cc'd to me :)

Athul