public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Friesen <cfriesen@nortelnetworks.com>
To: Dan Behman <dbehman@ca.ibm.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Hyperthreading: easiest userland method?
Date: Fri, 12 Sep 2003 11:10:49 -0400	[thread overview]
Message-ID: <3F61E1F9.6030409@nortelnetworks.com> (raw)
In-Reply-To: OFACE20891.664CABA8-ON85256D9F.004FBBDE@torolab.ibm.com

Dan Behman wrote:
> Hi,
> 
> I have a need to programmatically determine whether or not hyperthreading
> is enabled (and in use) for licensing reasons in my application.
> Currently, I know of two ways to do this:


> From scouring the archives and the net, it doesn't seem like there's any
> API that currently exists, but perhaps I've missed something.
> /proc/cpuinfo gathers its information from somewhere - is there a way in
> userland to bypass /proc/cpuinfo and directly get this data manually?

You could probably load a kernel module to check this stuff.

For 2.4, in arch/i386/kernel/setup.c, look for the code that checks for 
X86_FEATURE_HT.  You should be able to just copy that logic into a 
kernel module and export the result via /proc.

Chris

-- 
Chris Friesen                    | MailStop: 043/33/F10
Nortel Networks                  | work: (613) 765-0557
3500 Carling Avenue              | fax:  (613) 765-2986
Nepean, ON K2H 8E9 Canada        | email: cfriesen@nortelnetworks.com


  parent reply	other threads:[~2003-09-12 15:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-12 14:41 Hyperthreading: easiest userland method? Dan Behman
2003-09-12 14:55 ` dada1
2003-09-12 15:10 ` Chris Friesen [this message]
2003-09-12 16:12 ` Dave Hansen
  -- strict thread matches above, loose matches on Subject: below --
2003-09-12 17:00 Nakajima, Jun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F61E1F9.6030409@nortelnetworks.com \
    --to=cfriesen@nortelnetworks.com \
    --cc=dbehman@ca.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox