LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 07-01-2009, 04:49 AM   #1
shawshank_blr
LQ Newbie
 
Registered: Jul 2009
Posts: 8

Rep: Reputation: 0
Question how to programatically determine if hyperthreading is enabled in linux kernel


hi.. i know that the flag ‘ht’ in the /proc/cpuinfo flags section tells you that the physical cpu is capable of providing hyperthreading.

But how can i find out if the kernel is enabled for hyperthreading. Is there a way by which I can programatically find out this?
Please help….
 
Old 07-03-2009, 06:33 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
I think the kernel just counts the amount of cores and switches from UP to MP?
 
Old 07-03-2009, 07:14 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,139

Rep: Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122
The kernel isn't ever "enabled" for hyperthreading. As unSpawn said, unless a kernel is specifically non-SMP, it will use all apparent CPUs for dispatch. Hyperthreading is of course not really multiple CPUs (cores), hence the use of "apparent".
There is an indicator to assist the scheduler (CONFIG_SCHED_SMT ), but I don't know of a way to test for it other than the obvious scan of the kernel config file, which may not be available in all cases.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to determine enabled services from ldap. shibu_sp Linux - Server 2 07-13-2009 06:23 AM
Ripping audio CD's... How to determine if DMA is enabled?? -=Graz=- Ubuntu 2 05-31-2006 07:39 AM
How to determine major, minor programatically markjuggles Programming 1 04-15-2005 01:09 PM
How 2 see 2 CPU when P4 HyperThreading enabled? actteoh Linux - Hardware 5 05-07-2004 10:21 AM
P4 with Hyperthreading: Should the SMP support be enabled at kernel level? davidas Linux - Software 2 04-05-2004 11:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 12:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration