2002-08-21 11:28:31

by Reed, Timothy A

[permalink] [raw]
Subject: Hyperthreading

Anyone,

Can anyone lead me to a good source of information on what options should be
in the kernel for hyperthreading?? I am still fighting with a
sub-contractor over kernel options.


TIA

Tim

[email protected]


2002-08-21 13:44:19

by James Bourne

[permalink] [raw]
Subject: Re: Hyperthreading

On Wed, 21 Aug 2002, Reed, Timothy A wrote:

> Anyone,
>
> Can anyone lead me to a good source of information on what options should be
> in the kernel for hyperthreading?? I am still fighting with a
> sub-contractor over kernel options.

As long as you have a P4 and use the P4 support you will get
hyperthreading with 2.4.19 (CONFIG_MPENTIUM4=y). 2.4.18 you have to also
turn it on with a lilo option of acpismp=force on the kernel command line.

You might want to balance IRQs across the cpus. Ingo Molnar has created
patches for this, which I've put on my website
at http://www.hardrock.org/kernel/.

hyperthreading will give you some performance boostes, but *only*
if you have many runable processes a majority of the time, or very heavily
threaded applications running on the system. (an example would
be running 4 setiathome clients on a dual processor system).

regards
James Bourne

> Tim
>
> [email protected]

--
James Bourne, Supervisor Data Centre Operations
Mount Royal College, Calgary, AB, CA
http://www.mtroyal.ab.ca

******************************************************************************
This communication is intended for the use of the recipient to which it is
addressed, and may contain confidential, personal, and or privileged
information. Please contact the sender immediately if you are not the
intended recipient of this communication, and do not copy, distribute, or
take action relying on it. Any communication received in error, or
subsequent reply, should be deleted or destroyed.
******************************************************************************


"There are only 10 types of people in this world: those who
understand binary and those who don't."



2002-08-21 17:28:32

by Hugh Dickins

[permalink] [raw]
Subject: Re: Hyperthreading

On Wed, 21 Aug 2002, James Bourne wrote:
> On Wed, 21 Aug 2002, Reed, Timothy A wrote:
> >
> > Can anyone lead me to a good source of information on what options should be
> > in the kernel for hyperthreading?? I am still fighting with a
> > sub-contractor over kernel options.
>
> As long as you have a P4 and use the P4 support you will get
> hyperthreading with 2.4.19 (CONFIG_MPENTIUM4=y). 2.4.18 you have to also
> turn it on with a lilo option of acpismp=force on the kernel command line.

You do need CONFIG_SMP and a processor capable of HyperThreading,
i.e. Pentium 4 XEON; but CONFIG_MPENTIUM4 is not necessary for HT,
just appropriate to that processor in other ways.

Hugh

2002-08-21 21:14:48

by Kelsey Hudson

[permalink] [raw]
Subject: Re: Hyperthreading

On Wed, 21 Aug 2002, James Bourne wrote:

> On Wed, 21 Aug 2002, Hugh Dickins wrote:
>
> > You do need CONFIG_SMP and a processor capable of HyperThreading,
> > i.e. Pentium 4 XEON; but CONFIG_MPENTIUM4 is not necessary for HT,
> > just appropriate to that processor in other ways.
>
> I was under the impression that the only CPU capable of hyperthreading was
> the P4 Xeon. Is this not correct? I don't know of any other CPUs that
> have the ht feature.

This is currently correct, although I believe Intel has plans to release a
Hyperthreading-capable version of its desktop P4.

> Also, looking at setup.c it's hard to determine if CONFIG_SMP is
> actually required, but it doesn't look like it...

Of course it's required. How are you to take advantage of a "second CPU"
if your scheduler only works on a uniprocessor machine?

--
Kelsey Hudson [email protected]
Software Engineer/UNIX Systems Administrator
Compendium Technologies, Inc (619) 725-0771
---------------------------------------------------------------------------

2002-08-21 22:24:12

by Banai Zoltan

[permalink] [raw]
Subject: Re: Hyperthreading

On Wed, Aug 21, 2002 at 02:16:11PM -0700, Kelsey Hudson wrote:
> On Wed, 21 Aug 2002, James Bourne wrote:
>
> > On Wed, 21 Aug 2002, Hugh Dickins wrote:
> >
> > > You do need CONFIG_SMP and a processor capable of HyperThreading,
> > > i.e. Pentium 4 XEON; but CONFIG_MPENTIUM4 is not necessary for HT,
> > > just appropriate to that processor in other ways.
> >
> > I was under the impression that the only CPU capable of hyperthreading was
> > the P4 Xeon. Is this not correct? I don't know of any other CPUs that
> > have the ht feature.
>
> This is currently correct, although I believe Intel has plans to release a
> Hyperthreading-capable version of its desktop P4.

If this is correct, and there is not destop P4 capable of ht,
then what does mean the ht flag in cpuinfo?

$cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 1
model name : Intel(R) Pentium(R) 4 CPU 1.70GHz
stepping : 2
cpu MHz : 1694.907
cache size : 256 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
bogomips : 3381.65
^^

>
> > Also, looking at setup.c it's hard to determine if CONFIG_SMP is
> > actually required, but it doesn't look like it...
>
> Of course it's required. How are you to take advantage of a "second CPU"
> if your scheduler only works on a uniprocessor machine?
>
> --
> Kelsey Hudson [email protected]
> Software Engineer/UNIX Systems Administrator
> Compendium Technologies, Inc (619) 725-0771
> ---------------------------------------------------------------------------
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/

--
Banai Zoltan

2002-08-21 22:52:51

by Nakajima, Jun

[permalink] [raw]
Subject: RE: Hyperthreading

Since Pentium 4 and Xeon share the same core, you see the HT bit on Pentium
4 as well. The HT bit does not mean HT is enabled (you can enable/disable
usually by the BIOS setup), but the number of the threads (i.e. logical
CPUs) in a processor package must be 2 (via cpuid instruction) so that the
OS can be sure that HT is enabled (see setup.c). The HT bit is just useful
as a prerequisite for HT.

Thanks,
Jun
-----Original Message-----
From: Banai Zoltan [mailto:[email protected]]
Sent: Wednesday, August 21, 2002 2:55 PM
To: Kelsey Hudson
Cc: James Bourne; Hugh Dickins; Reed, Timothy A;
[email protected]
Subject: Re: Hyperthreading


On Wed, Aug 21, 2002 at 02:16:11PM -0700, Kelsey Hudson wrote:
> On Wed, 21 Aug 2002, James Bourne wrote:
>
> > On Wed, 21 Aug 2002, Hugh Dickins wrote:
> >
> > > You do need CONFIG_SMP and a processor capable of HyperThreading,
> > > i.e. Pentium 4 XEON; but CONFIG_MPENTIUM4 is not necessary for HT,
> > > just appropriate to that processor in other ways.
> >
> > I was under the impression that the only CPU capable of hyperthreading
was
> > the P4 Xeon. Is this not correct? I don't know of any other CPUs that
> > have the ht feature.
>
> This is currently correct, although I believe Intel has plans to release a

> Hyperthreading-capable version of its desktop P4.

If this is correct, and there is not destop P4 capable of ht,
then what does mean the ht flag in cpuinfo?

$cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 1
model name : Intel(R) Pentium(R) 4 CPU 1.70GHz
stepping : 2
cpu MHz : 1694.907
cache size : 256 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
bogomips : 3381.65
^^

>
> > Also, looking at setup.c it's hard to determine if CONFIG_SMP is
> > actually required, but it doesn't look like it...
>
> Of course it's required. How are you to take advantage of a "second CPU"
> if your scheduler only works on a uniprocessor machine?
>
> --
> Kelsey Hudson [email protected]
> Software Engineer/UNIX Systems Administrator
> Compendium Technologies, Inc (619) 725-0771
>
---------------------------------------------------------------------------
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/

--
Banai Zoltan

2002-08-21 23:40:49

by Alan

[permalink] [raw]
Subject: RE: Hyperthreading

On Wed, 2002-08-21 at 23:56, Nakajima, Jun wrote:
> Since Pentium 4 and Xeon share the same core, you see the HT bit on Pentium
> 4 as well. The HT bit does not mean HT is enabled (you can enable/disable
> usually by the BIOS setup), but the number of the threads (i.e. logical
> CPUs) in a processor package must be 2 (via cpuid instruction) so that the
> OS can be sure that HT is enabled (see setup.c). The HT bit is just useful
> as a prerequisite for HT.

If you want to know the full HT capabilities of the processor you need
to read cpuid 1 and check ebx bits 16-23.

There has been some interesting speculation as to whether you can enable
HT by undocumented mtrrs on cpus that have "ht" but claim not to be
doing HT. Clearly the value returned is settable somewhere but I've seen
no proof yet than you can enable HT on non PIV Xeons this way.

2002-08-22 07:57:03

by Luigi Genoni

[permalink] [raw]
Subject: Re: Hyperthreading

On Wed, 21 Aug 2002, Kelsey Hudson wrote:

> Date: Wed, 21 Aug 2002 14:16:11 -0700 (PDT)
> From: Kelsey Hudson <[email protected]>
> To: James Bourne <[email protected]>
> Cc: Hugh Dickins <[email protected]>,
> "Reed, Timothy A" <[email protected]>,
> [email protected]
> Subject: Re: Hyperthreading
>
> On Wed, 21 Aug 2002, James Bourne wrote:
>
> > On Wed, 21 Aug 2002, Hugh Dickins wrote:
> >
> > > You do need CONFIG_SMP and a processor capable of HyperThreading,
> > > i.e. Pentium 4 XEON; but CONFIG_MPENTIUM4 is not necessary for HT,
> > > just appropriate to that processor in other ways.
> >
> > I was under the impression that the only CPU capable of hyperthreading was
> > the P4 Xeon. Is this not correct? I don't know of any other CPUs that
> > have the ht feature.
>
> This is currently correct, although I believe Intel has plans to release a
> Hyperthreading-capable version of its desktop P4.

basically all PIV are capable of hyperthreading, non just Xeon, but it is
disabled and there is not way to enable it in Bios, so the most hang at
boot when you try to activate hyperthreading on them




2002-08-22 08:01:38

by Luigi Genoni

[permalink] [raw]
Subject: Re: Hyperthreading

On Wed, 21 Aug 2002, Banai Zoltan wrote:

> Date: Wed, 21 Aug 2002 23:55:03 +0200
> From: Banai Zoltan <[email protected]>
> To: Kelsey Hudson <[email protected]>
> Cc: James Bourne <[email protected]>, Hugh Dickins <[email protected]>,
> "Reed, Timothy A" <[email protected]>,
> [email protected]
> Subject: Re: Hyperthreading
>
> On Wed, Aug 21, 2002 at 02:16:11PM -0700, Kelsey Hudson wrote:
> > On Wed, 21 Aug 2002, James Bourne wrote:
> >
> > > On Wed, 21 Aug 2002, Hugh Dickins wrote:
> > >
> > > > You do need CONFIG_SMP and a processor capable of HyperThreading,
> > > > i.e. Pentium 4 XEON; but CONFIG_MPENTIUM4 is not necessary for HT,
> > > > just appropriate to that processor in other ways.
> > >
> > > I was under the impression that the only CPU capable of hyperthreading was
> > > the P4 Xeon. Is this not correct? I don't know of any other CPUs that
> > > have the ht feature.
> >
> > This is currently correct, although I believe Intel has plans to release a
> > Hyperthreading-capable version of its desktop P4.
>
> If this is correct, and there is not destop P4 capable of ht,
> then what does mean the ht flag in cpuinfo?
>
> $cat /proc/cpuinfo
> processor : 0
> vendor_id : GenuineIntel
> cpu family : 15
> model : 1
> model name : Intel(R) Pentium(R) 4 CPU 1.70GHz
> stepping : 2
> cpu MHz : 1694.907
> cache size : 256 KB
> fdiv_bug : no
> hlt_bug : no
> f00f_bug : no
> coma_bug : no
> fpu : yes
> fpu_exception : yes
> cpuid level : 2
> wp : yes
> flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
> mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
> bogomips : 3381.65
> ^^
In fact all PIV are capable of ht, but usually there is way to enable due
to bioses and similar



2002-08-22 09:11:48

by Marc Dietrich

[permalink] [raw]
Subject: Re: Hyperthreading

On Wed, 21 Aug 2002, Hugh Dickens wrote:
> On Wed, 21 Aug 2002, James Bourne wrote:
> > On Wed, 21 Aug 2002, Reed, Timothy A wrote:
> > >
> > > Can anyone lead me to a good source of information on what options >
should be
> > > in the kernel for hyperthreading?? I am still fighting with a
> > > sub-contractor over kernel options.
> >
> > As long as you have a P4 and use the P4 support you will get
> > hyperthreading with 2.4.19 (CONFIG_MPENTIUM4=y). 2.4.18 you have to also
> > turn it on with a lilo option of acpismp=force on the kernel command line.
>
> You do need CONFIG_SMP and a processor capable of HyperThreading,
> i.e. Pentium 4 XEON; but CONFIG_MPENTIUM4 is not necessary for HT,
> just appropriate to that processor in other ways.

Hi,

I used KNOPPIX on a 2 way Dell WS 530 (Xeon 2.0 GHz). This distribution has
CONFIG_M386 set (as most others also?) and HT was not enabled. I compiled the
kernel myself (same config as KNOPPIX but with CONFIG_MPENTIUM4) and HT gets
enabled. So is _does_ matter for which processor the kernel is optimized.

Greetings

Marc

--
Marc Dietrich

2002-08-22 11:54:29

by Nir Soffer

[permalink] [raw]
Subject: RE: Hyperthreading

> On Wed, 21 Aug 2002, James Bourne wrote:
> > On Wed, 21 Aug 2002, Reed, Timothy A wrote:
> > >
> > > Can anyone lead me to a good source of information on
> what options should be
> > > in the kernel for hyperthreading?? I am still fighting with a
> > > sub-contractor over kernel options.
> >
> > As long as you have a P4 and use the P4 support you will get
> > hyperthreading with 2.4.19 (CONFIG_MPENTIUM4=y). 2.4.18
> you have to also
> > turn it on with a lilo option of acpismp=force on the
> kernel command line.
>
> You do need CONFIG_SMP and a processor capable of HyperThreading,
> i.e. Pentium 4 XEON; but CONFIG_MPENTIUM4 is not necessary for HT,
> just appropriate to that processor in other ways.
>
> Hugh

Grepping for MPENTIUM4 in the tree only shows up that it causes the
kernel to be compiled with -march=i686, much like M686 and MPENTIUMIII.
Are there more subtle ways it affects the kernel that I missed? (in the
2.4.x tree)

Thanks,
Nir.

--
Nir Soffer -=- Software Engineer, Exanet Inc. -=-
"Father, why are all the children weeping? / They are merely crying son
O, are they merely crying, father? / Yes, true weeping is yet to come"
-- Nick Cave and the Bad Seeds, The Weeping Song

2002-08-22 14:01:31

by Hugh Dickins

[permalink] [raw]
Subject: Re: Hyperthreading

On Thu, 22 Aug 2002, Marc Dietrich wrote:
> On Wed, 21 Aug 2002, Hugh Dickins wrote:
> >
> > You do need CONFIG_SMP and a processor capable of HyperThreading,
> > i.e. Pentium 4 XEON; but CONFIG_MPENTIUM4 is not necessary for HT,
> > just appropriate to that processor in other ways.
>
> I used KNOPPIX on a 2 way Dell WS 530 (Xeon 2.0 GHz). This distribution has
> CONFIG_M386 set (as most others also?) and HT was not enabled. I compiled the
> kernel myself (same config as KNOPPIX but with CONFIG_MPENTIUM4) and HT gets
> enabled. So is _does_ matter for which processor the kernel is optimized.

I'm surprised - perhaps the Knoppix distribution did not have SMP enabled
itself, but installed a config with CONFIG_SMP? Or you built more recent
kernel sources (2.4.19 defaults to HT on) than the Knoppix distribution
(vanilla 2.4.18 defaults to HT off)?

It would be awkward for me to try CONFIG_M386 on our P4 Xeon, but I did
just try building a CONFIG_M586 CONFIG_SMP kernel for it, which behaved
as I expected: /proc/cpuinfo showed 4 cpus, but only 2 cpus when booted
with "noht".

Hugh

2002-08-22 14:25:36

by Hugh Dickins

[permalink] [raw]
Subject: RE: Hyperthreading

On Thu, 22 Aug 2002, Nir Soffer wrote:
>
> Grepping for MPENTIUM4 in the tree only shows up that it causes the
> kernel to be compiled with -march=i686, much like M686 and MPENTIUMIII.
> Are there more subtle ways it affects the kernel that I missed? (in the
> 2.4.x tree)

arch/i386/config.in is where the processor characteristics CONFIG_X86_...
are derived from processor type. There's only one difference between
the CONFIG_MPENTIUMIII configs and the CONFIG_MPENTIUM4 configs (in
2.4.18 or 2.4.19 or 2.4.20-pre4): CONFIG_X86_L1_CACHE_SHIFT 5 or 7.

Alan, that reminds me: 2.4.20-ac sets CONFIG_X86_L1_CACHE_SHIFT 7
when CONFIG_MPENTIUMIII: looks wrong, but perhaps there's a reason?

Hugh

2002-08-22 14:33:07

by Marc Dietrich

[permalink] [raw]
Subject: Re: Hyperthreading

Am Donnerstag, 22. August 2002 :06 schrieben Sie:
> On Thu, 22 Aug 2002, Marc Dietrich wrote:
> > On Wed, 21 Aug 2002, Hugh Dickins wrote:
> > > You do need CONFIG_SMP and a processor capable of HyperThreading,
> > > i.e. Pentium 4 XEON; but CONFIG_MPENTIUM4 is not necessary for HT,
> > > just appropriate to that processor in other ways.
> >
> > I used KNOPPIX on a 2 way Dell WS 530 (Xeon 2.0 GHz). This distribution
> > has CONFIG_M386 set (as most others also?) and HT was not enabled. I
> > compiled the kernel myself (same config as KNOPPIX but with
> > CONFIG_MPENTIUM4) and HT gets enabled. So is _does_ matter for which
> > processor the kernel is optimized.
>
> I'm surprised - perhaps the Knoppix distribution did not have SMP enabled
> itself, but installed a config with CONFIG_SMP? Or you built more recent
> kernel sources (2.4.19 defaults to HT on) than the Knoppix distribution
> (vanilla 2.4.18 defaults to HT off)?

I don't think so. Original kernel gives me 2 penguins and cpuinfo shows 2
cpu's. Kernel is 2.4.19 with xfs patches and there is no "noht" option. I
attached a dmesg file of this one. Btw, setting the processor also sets some
other options (CMPXCHG, TCS, PGE, ...).

> It would be awkward for me to try CONFIG_M386 on our P4 Xeon, but I did
> just try building a CONFIG_M586 CONFIG_SMP kernel for it, which behaved
> as I expected: /proc/cpuinfo showed 4 cpus, but only 2 cpus when booted
> with "noht".

Give it a try. A dual Xeon won't take to much time to compile a new kernel ;)

Greetings

Marc

--
Marc Dietrich

2002-08-23 07:23:45

by Gilad Ben-Yossef

[permalink] [raw]
Subject: Re: Hyperthreading

On Wed, 2002-08-21 at 20:33, Hugh Dickins wrote:
> On Wed, 21 Aug 2002, James Bourne wrote:
> > On Wed, 21 Aug 2002, Reed, Timothy A wrote:
> > >
> > > Can anyone lead me to a good source of information on what options should be
> > > in the kernel for hyperthreading?? I am still fighting with a
> > > sub-contractor over kernel options.
> >
> > As long as you have a P4 and use the P4 support you will get
> > hyperthreading with 2.4.19 (CONFIG_MPENTIUM4=y). 2.4.18 you have to also
> > turn it on with a lilo option of acpismp=force on the kernel command line.
>
> You do need CONFIG_SMP and a processor capable of HyperThreading,
> i.e. Pentium 4 XEON; but CONFIG_MPENTIUM4 is not necessary for HT,
> just appropriate to that processor in other ways.


hmm... isn't there an option to tell the kernel you are using a
HyperThreaded system, or is it detected on runtime? I mean, think about
a P4 Xeon 2 way SMP - unless told otherwise the kernel will 'see' it as
a 4 way SMP box *but* the proccessors are not equel!

If for example, you have a task running and another task just woke up
and the scheduler needs to assign a CPU for it, choosing the other
'instance' of the same CPU as the already running task to run it on as
opposed to choosing one of the 'instanaces' of the other seperate CPU
seems a mistake IMHO, but the scheduler won't be able to make the
judgment because it doesn't know it is running on a SMT box at all.

Or am I missing something? :-)

Gilad.

--
Gilad Ben-Yossef <[email protected]>
http://benyossef.com

"Money talks, bullshit walks and GNU awks."
-- Shachar "Sun" Shemesh, debt collector for the GNU/Yakuza

2002-08-23 08:05:53

by Hugh Dickins

[permalink] [raw]
Subject: Re: Hyperthreading

On 23 Aug 2002, Gilad Ben-Yossef wrote:
>
> hmm... isn't there an option to tell the kernel you are using a
> HyperThreaded system, or is it detected on runtime? I mean, think about
> a P4 Xeon 2 way SMP - unless told otherwise the kernel will 'see' it as
> a 4 way SMP box *but* the proccessors are not equel!

There is the "noht" boot arg to tell the kernel not to use HT,
and there is the X86_FEATURE_HT cpu capability flag, but I think
the runtime indication you're looking for is smp_num_siblings:
1 without HT, 2 (ever more?) with HT.

> If for example, you have a task running and another task just woke up
> and the scheduler needs to assign a CPU for it, choosing the other
> 'instance' of the same CPU as the already running task to run it on as
> opposed to choosing one of the 'instanaces' of the other seperate CPU
> seems a mistake IMHO, but the scheduler won't be able to make the
> judgment because it doesn't know it is running on a SMT box at all.

SMT I don't know. Your point is valid, and you'll find the 2.4 -aa
and -ac trees (both using newer O1 scheduler) each have code in (or
called out from) kernel/sched.c to deal with that.

The mainline 2.4 does not take that into consideration, and so far
as I can see (please correct me), nor does 2.5 as yet - will probably
get added from 2.4 -aa or -ac in due course. It's not an issue of
correctness, just optimality.

Hugh

2002-08-23 08:08:48

by Luigi Genoni

[permalink] [raw]
Subject: Re: Hyperthreading

On 23 Aug 2002, Gilad Ben-Yossef wrote:

> Date: 23 Aug 2002 10:28:08 +0300
> From: Gilad Ben-Yossef <[email protected]>
> To: Hugh Dickins <[email protected]>
> Cc: James Bourne <[email protected]>,
> "Reed, Timothy A" <[email protected]>,
> [email protected]
> Subject: Re: Hyperthreading
>
> On Wed, 2002-08-21 at 20:33, Hugh Dickins wrote:
> > On Wed, 21 Aug 2002, James Bourne wrote:
> > > On Wed, 21 Aug 2002, Reed, Timothy A wrote:
> > > >
> > > > Can anyone lead me to a good source of information on what options should be
> > > > in the kernel for hyperthreading?? I am still fighting with a
> > > > sub-contractor over kernel options.
> > >
> > > As long as you have a P4 and use the P4 support you will get
> > > hyperthreading with 2.4.19 (CONFIG_MPENTIUM4=y). 2.4.18 you have to also
> > > turn it on with a lilo option of acpismp=force on the kernel command line.
> >
> > You do need CONFIG_SMP and a processor capable of HyperThreading,
> > i.e. Pentium 4 XEON; but CONFIG_MPENTIUM4 is not necessary for HT,
> > just appropriate to that processor in other ways.
>
>
> hmm... isn't there an option to tell the kernel you are using a
> HyperThreaded system, or is it detected on runtime? I mean, think about
> a P4 Xeon 2 way SMP - unless told otherwise the kernel will 'see' it as
> a 4 way SMP box *but* the proccessors are not equel!
>
> If for example, you have a task running and another task just woke up
> and the scheduler needs to assign a CPU for it, choosing the other
> 'instance' of the same CPU as the already running task to run it on as
> opposed to choosing one of the 'instanaces' of the other seperate CPU
> seems a mistake IMHO, but the scheduler won't be able to make the
> judgment because it doesn't know it is running on a SMT box at all.
>
> Or am I missing something? :-)
>
with a dual processor with hyper threading where the kernel sees
CPU0-CPU1 (first CPU) and CPU2-CPU3 (second CPU), and you run a cpu
wasting job, it will be scheduled on CPU0, then the second CPU wastint job
will be scheduled on CPU2, and so on, with this alternation
CPU0-CPU2-CPU1-CPU3. So, as you see, the scheduler is smarter, and this
way it CPUs are used at best for what the system can. Then maybe there
could be some discussion about MPI jobs, (I should make some test, and I
am curious to listen someone else experience).

Luigi



2002-08-23 08:22:22

by Alan

[permalink] [raw]
Subject: Re: Hyperthreading

On Fri, 2002-08-23 at 09:10, Hugh Dickins wrote
> The mainline 2.4 does not take that into consideration, and so far
> as I can see (please correct me), nor does 2.5 as yet - will probably
> get added from 2.4 -aa or -ac in due course. It's not an issue of
> correctness, just optimality.

Its disabled in -ac too. The scheduling balance patches were causing
crashes

2002-08-26 18:59:25

by Kelsey Hudson

[permalink] [raw]
Subject: Re: Hyperthreading

On Wed, 21 Aug 2002, Banai Zoltan wrote:

> If this is correct, and there is not destop P4 capable of ht,
> then what does mean the ht flag in cpuinfo?

That's a good question. I'm not sure.

> $cat /proc/cpuinfo
> processor : 0
> vendor_id : GenuineIntel
> cpu family : 15
> model : 1
> model name : Intel(R) Pentium(R) 4 CPU 1.70GHz
> stepping : 2
> cpu MHz : 1694.907
> cache size : 256 KB
> fdiv_bug : no
> hlt_bug : no
> f00f_bug : no
> coma_bug : no
> fpu : yes
> fpu_exception : yes
> cpuid level : 2
> wp : yes
> flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
> mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
> bogomips : 3381.65
> ^^

You could always compile an SMP kernel and turn on ACPI System support...
If your machine boots up and shows two CPUs, it's hyperthread-capable.
Note that your BIOS also must support this feature...

--
Kelsey Hudson [email protected]
Software Engineer/UNIX Systems Administrator
Compendium Technologies, Inc (619) 725-0771
---------------------------------------------------------------------------

2002-08-21 19:30:52

by James Bourne

[permalink] [raw]
Subject: Re: Hyperthreading

On Wed, 21 Aug 2002, Hugh Dickins wrote:

> You do need CONFIG_SMP and a processor capable of HyperThreading,
> i.e. Pentium 4 XEON; but CONFIG_MPENTIUM4 is not necessary for HT,
> just appropriate to that processor in other ways.

I was under the impression that the only CPU capable of hyperthreading was
the P4 Xeon. Is this not correct? I don't know of any other CPUs that
have the ht feature.

Also, looking at setup.c it's hard to determine if CONFIG_SMP is
actually required, but it doesn't look like it...

Regards
James Bourne

>
> Hugh
>

--
James Bourne, Supervisor Data Centre Operations
Mount Royal College, Calgary, AB, CA
http://www.mtroyal.ab.ca

******************************************************************************
This communication is intended for the use of the recipient to which it is
addressed, and may contain confidential, personal, and or privileged
information. Please contact the sender immediately if you are not the
intended recipient of this communication, and do not copy, distribute, or
take action relying on it. Any communication received in error, or
subsequent reply, should be deleted or destroyed.
******************************************************************************


"There are only 10 types of people in this world: those who
understand binary and those who don't."