Main Page | Report this Page
Linux Forum Index  »  Linux Miscellaneous Topics 2  »  Hyperthreading DECREASES performance? There ought to...
Page 1 of 3    Goto page 1, 2, 3  Next

Hyperthreading DECREASES performance? There ought to...

Author Message
Ignoramus27237...
Posted: Tue Oct 27, 2009 4:31 pm
Guest
At work, we have some users who ru a multithreaded app, and they need
every single bit of performance we can squeeze from computers.

We are looking into whether we can obtain additional speed performance
from using Intel hyperthreading, as opposed to disabling
hyperthreading.

If we are able to get benefits from hyperthreading, it will be a huge
argument towards converting certain high end users desktops to Linux
from Windows XP.

I wrote a test perl script, that starts several tasks in parallel. All
these tasks perform a certain amount of calculations and exit. The
test completes when all of them exit.

The results were actually a disappointment, if the number of tasks was
equal to the number of physical cores. For the test with four parallel
subprocesses, on four CPUs, It takes longer to run it with HT than
without HT.

I think that I understand why.

What I found is that not all of these parallel tasks finish at the
same time. This happens because often times, two tasks are assigned to
two logical CPUs that share the same core, and some tasks are assigned
to only one core, whereas some cores are idling.

I cannot believe that I am the only guy with this problem, and hope
that the Linux community has found a solution. For example, perhaps
they can assign higher priority to some logical CPUs (say, to 0, 2, 4,
6) and lower priority to others. This way the higher priority ones
would be filled with tunning tasks, before fake "shadow processors"
1,3,5,7 are utilized.

I would like to know if perhaps there is a boot option to this effect.

This is Ubuntu Hardy, 2.6.24 kernel.

Thanks
 
Brian Gregory [UK]...
Posted: Tue Oct 27, 2009 4:54 pm
Guest
"Ignoramus27237" <ignoramus27237 at (no spam) NOSPAM.27237.invalid> wrote in message
news:d-udnb0465VD6XrXnZ2dnUVZ_jmdnZ2d at (no spam) giganews.com...
Quote:

At work, we have some users who ru a multithreaded app, and they need
every single bit of performance we can squeeze from computers.

We are looking into whether we can obtain additional speed performance
from using Intel hyperthreading, as opposed to disabling
hyperthreading.

If we are able to get benefits from hyperthreading, it will be a huge
argument towards converting certain high end users desktops to Linux
from Windows XP.

I wrote a test perl script, that starts several tasks in parallel. All
these tasks perform a certain amount of calculations and exit. The
test completes when all of them exit.

The results were actually a disappointment, if the number of tasks was
equal to the number of physical cores. For the test with four parallel
subprocesses, on four CPUs, It takes longer to run it with HT than
without HT.

I think that I understand why.

What I found is that not all of these parallel tasks finish at the
same time. This happens because often times, two tasks are assigned to
two logical CPUs that share the same core, and some tasks are assigned
to only one core, whereas some cores are idling.

I cannot believe that I am the only guy with this problem, and hope
that the Linux community has found a solution. For example, perhaps
they can assign higher priority to some logical CPUs (say, to 0, 2, 4,
6) and lower priority to others. This way the higher priority ones
would be filled with tunning tasks, before fake "shadow processors"
1,3,5,7 are utilized.

I would like to know if perhaps there is a boot option to this effect.

This is Ubuntu Hardy, 2.6.24 kernel.

One would hope that on any system with hyperthreading processors the cores
would all be busy with one thread before any would be asked to execute a
second thread. It seems like common sense to me and I'd be amazed if any
operating system did differently.

--

Brian Gregory. (In the UK)
ng at (no spam) bgdsv.co.uk
To email me remove the letter vee.
 
General Schvantzkoph...
Posted: Tue Oct 27, 2009 4:58 pm
Guest
On Tue, 27 Oct 2009 17:31:58 -0500, Ignoramus27237 wrote:

Quote:
At work, we have some users who ru a multithreaded app, and they need
every single bit of performance we can squeeze from computers.

We are looking into whether we can obtain additional speed performance
from using Intel hyperthreading, as opposed to disabling hyperthreading.

If we are able to get benefits from hyperthreading, it will be a huge
argument towards converting certain high end users desktops to Linux
from Windows XP.

I wrote a test perl script, that starts several tasks in parallel. All
these tasks perform a certain amount of calculations and exit. The test
completes when all of them exit.

The results were actually a disappointment, if the number of tasks was
equal to the number of physical cores. For the test with four parallel
subprocesses, on four CPUs, It takes longer to run it with HT than
without HT.

I think that I understand why.

What I found is that not all of these parallel tasks finish at the same
time. This happens because often times, two tasks are assigned to two
logical CPUs that share the same core, and some tasks are assigned to
only one core, whereas some cores are idling.

I cannot believe that I am the only guy with this problem, and hope that
the Linux community has found a solution. For example, perhaps they can
assign higher priority to some logical CPUs (say, to 0, 2, 4, 6) and
lower priority to others. This way the higher priority ones would be
filled with tunning tasks, before fake "shadow processors" 1,3,5,7 are
utilized.

I would like to know if perhaps there is a boot option to this effect.

This is Ubuntu Hardy, 2.6.24 kernel.

Thanks

You should try the experiment with a modern kernel, 2.6.30 for example.
What I've found is that the effect is very small, there is a slight
increase in thoughput and there is almost no decrease in single thread
performance. In the P4 days hyperthreading killed the single thread
performance but improved the total throughput. In the iCore7
hyperthreading makes very little difference either way. I'm running with
HT on because it seems harmless and there is a tiny increase in
thorughput, see the example below,

time make -j 4
13.382u 1.240s 0:06.85 213.4% 0+0k 0+35088io 0pf+0w

time make -j 8
13.446u 1.148s 0:06.44 226.3% 0+0k 0+35088io 0pf+0w
 
Grant...
Posted: Tue Oct 27, 2009 5:05 pm
Guest
On Tue, 27 Oct 2009 17:31:58 -0500, Ignoramus27237 <ignoramus27237 at (no spam) NOSPAM.27237.invalid> wrote:

Quote:

At work, we have some users who ru a multithreaded app, and they need
every single bit of performance we can squeeze from computers.

....
I cannot believe that I am the only guy with this problem, and hope
that the Linux community has found a solution. For example, perhaps
they can assign higher priority to some logical CPUs (say, to 0, 2, 4,
6) and lower priority to others. This way the higher priority ones
would be filled with tunning tasks, before fake "shadow processors"
1,3,5,7 are utilized.

I would like to know if perhaps there is a boot option to this effect.

This is Ubuntu Hardy, 2.6.24 kernel.

Not a boot option, but a more recent kernel (current -stable branch is

2.6.31.5) has better control with separate controls for multi-core and
HT.

Of course HT is sharing CPU, so it is benefit only for some types
of loads -- somethinmes there's an improvement when it's turned
off, but I think this is BIOS option?

Grant.
--
http://bugsplatter.id.au
 
Ignoramus27237...
Posted: Tue Oct 27, 2009 5:17 pm
Guest
On 2009-10-27, Brian Gregory [UK] <ng at (no spam) bgdsv.co.uk> wrote:
Quote:
I would like to know if perhaps there is a boot option to this effect.

This is Ubuntu Hardy, 2.6.24 kernel.

One would hope that on any system with hyperthreading processors the
cores would all be busy with one thread before any would be asked to
execute a second thread. It seems like common sense to me and I'd be
amazed if any operating system did differently.

I was actually amazed for the same reason. Possibly, by the time the
kernel is running, it cannot even determine if it is running under
hyperthreaded CPUs or not, and needs to be told that. This is what I
am trying to find out.

I did find, in google, some old discussions involving Ingo and talking
about scheduler improvements. What I have not found is what should I
do to take advantage of these supposed improvements.

i
 
General Schvantzkoph...
Posted: Tue Oct 27, 2009 5:29 pm
Guest
On Tue, 27 Oct 2009 18:17:33 -0500, Ignoramus27237 wrote:

Quote:
On 2009-10-27, Brian Gregory [UK] <ng at (no spam) bgdsv.co.uk> wrote:
I would like to know if perhaps there is a boot option to this effect.

This is Ubuntu Hardy, 2.6.24 kernel.

One would hope that on any system with hyperthreading processors the
cores would all be busy with one thread before any would be asked to
execute a second thread. It seems like common sense to me and I'd be
amazed if any operating system did differently.

I was actually amazed for the same reason. Possibly, by the time the
kernel is running, it cannot even determine if it is running under
hyperthreaded CPUs or not, and needs to be told that. This is what I am
trying to find out.

I did find, in google, some old discussions involving Ingo and talking
about scheduler improvements. What I have not found is what should I do
to take advantage of these supposed improvements.

i

The very first thing you need to do is run your tests on the current
kernel, try it on Fedora 12 or Ubuntu 9.10 which have the 2.6.31. If you
don't want to run a beta then try F11 which has a 2.6.30 kernel. The
2.6.24 kernel predates the iCore 7 so it's not going to have any iCore7
optimizations.
 
The Natural Philosopher...
Posted: Tue Oct 27, 2009 6:02 pm
Guest
Ignoramus27237 wrote:
Quote:
At work, we have some users who ru a multithreaded app, and they need
every single bit of performance we can squeeze from computers.

We are looking into whether we can obtain additional speed performance
from using Intel hyperthreading, as opposed to disabling
hyperthreading.

If we are able to get benefits from hyperthreading, it will be a huge
argument towards converting certain high end users desktops to Linux
from Windows XP.

I wrote a test perl script,

why would anyone use PERL for performance...
 
MCR...
Posted: Tue Oct 27, 2009 6:03 pm
Guest
On Wed, 28 Oct 2009 00:02:38 +0000, The Natural Philosopher wrote:

Snipped

Quote:
I wrote a test perl script,

why would anyone use PERL for performance...

BASIC FTW! ;)



--
╔═╦═╦══╦══╗ |42 is the answer dammit.
║ ║ ═╣ ║╚╗ |www.pleasuredome.org.uk - ROMs, Retro, Community
╚╩═╩╩══╩═╩═╝ |Linux - Humanity in computing
 
Ignoramus27237...
Posted: Tue Oct 27, 2009 6:23 pm
Guest
On 2009-10-28, The Natural Philosopher <tnp at (no spam) invalid.invalid> wrote:
Quote:
Ignoramus27237 wrote:
At work, we have some users who ru a multithreaded app, and they need
every single bit of performance we can squeeze from computers.

We are looking into whether we can obtain additional speed performance
from using Intel hyperthreading, as opposed to disabling
hyperthreading.

If we are able to get benefits from hyperthreading, it will be a huge
argument towards converting certain high end users desktops to Linux
from Windows XP.

I wrote a test perl script,

why would anyone use PERL for performance...


This was a test. The actual app is in C++. But a perl; script is a
much cleaner test because it is much simpler.

i
 
DanS...
Posted: Tue Oct 27, 2009 6:44 pm
Guest
Ignoramus27237 <ignoramus27237 at (no spam) NOSPAM.27237.invalid> wrote in
news:QtidnSTzfZ1mE3rXnZ2dnUVZ_tadnZ2d at (no spam) giganews.com:

Quote:
I wrote a test perl script,

why would anyone use PERL for performance...


This was a test. The actual app is in C++. But a perl; script is a
much cleaner test because it is much simpler.

Then its not very representative of the actual task.
 
Ignoramus27237...
Posted: Tue Oct 27, 2009 6:48 pm
Guest
On 2009-10-27, General Schvantzkoph <schvantzkoph at (no spam) yahoo.com> wrote:
Quote:

You should try the experiment with a modern kernel, 2.6.30 for example.

Well, 2.6.24 is only 1.5 years old if you count from its introduction
in Hardy. Hyperthreading is several years old. They talked about
hyperthreading in 2.5 and even 2.4 kernel.

Quote:
What I've found is that the effect is very small, there is a slight
increase in thoughput and there is almost no decrease in single thread
performance. In the P4 days hyperthreading killed the single thread
performance but improved the total throughput. In the iCore7
hyperthreading makes very little difference either way. I'm running with
HT on because it seems harmless and there is a tiny increase in
thorughput, see the example below,

time make -j 4
13.382u 1.240s 0:06.85 213.4% 0+0k 0+35088io 0pf+0w

time make -j 8
13.446u 1.148s 0:06.44 226.3% 0+0k 0+35088io 0pf+0w

Your make test is much more complicated than my parallel script. (in
terms of OS load).

I do believe that when I find the proper scheduler options, I will get
at least 20% benefit from HT.

i
 
General Schvantzkoph...
Posted: Tue Oct 27, 2009 7:16 pm
Guest
On Tue, 27 Oct 2009 19:48:44 -0500, Ignoramus27237 wrote:

Quote:
On 2009-10-27, General Schvantzkoph <schvantzkoph at (no spam) yahoo.com> wrote:

You should try the experiment with a modern kernel, 2.6.30 for example.

Well, 2.6.24 is only 1.5 years old if you count from its introduction in
Hardy. Hyperthreading is several years old. They talked about
hyperthreading in 2.5 and even 2.4 kernel.

2.26.24 is Feb 2008, the iCore7 wasn't introduced until the end of 2008
so there are no iCore7 optimizations in .24, the code that's there is
specific to the P4. You are wasting your time tuning .24, if you are
going to expend any effort you should do it for .31.
 
Ignoramus27237...
Posted: Tue Oct 27, 2009 7:55 pm
Guest
On 2009-10-28, DanS <t.h.i.s.n.t.h.a.t at (no spam) r.o.a.d.r.u.n.n.e.r.c.o.m> wrote:
Quote:
Ignoramus27237 <ignoramus27237 at (no spam) NOSPAM.27237.invalid> wrote in
news:QtidnSTzfZ1mE3rXnZ2dnUVZ_tadnZ2d at (no spam) giganews.com:

I wrote a test perl script,

why would anyone use PERL for performance...


This was a test. The actual app is in C++. But a perl; script is a
much cleaner test because it is much simpler.

Then it?s not very representative of the actual task.

It may not be representative of the actual task, but it is not very
far.

I really do not want the discussion to stray into this area.

i
 
Ignoramus27237...
Posted: Tue Oct 27, 2009 10:28 pm
Guest
On 2009-10-28, General Schvantzkoph <schvantzkoph at (no spam) yahoo.com> wrote:
Quote:
On Tue, 27 Oct 2009 19:48:44 -0500, Ignoramus27237 wrote:

On 2009-10-27, General Schvantzkoph <schvantzkoph at (no spam) yahoo.com> wrote:

You should try the experiment with a modern kernel, 2.6.30 for example.

Well, 2.6.24 is only 1.5 years old if you count from its introduction in
Hardy. Hyperthreading is several years old. They talked about
hyperthreading in 2.5 and even 2.4 kernel.

2.26.24 is Feb 2008, the iCore7 wasn't introduced until the end of 2008
so there are no iCore7 optimizations in .24, the code that's there is
specific to the P4. You are wasting your time tuning .24, if you are
going to expend any effort you should do it for .31.

General, here's a good paper from Intel:

http://software.intel.com/sites/oss/pdfs/mclinux.pdf

It happens to discuss the exact issue that I am having.

``In the presence of Hyperthreading, when the system has fewer tasks
compared to number of logical CPUs in the system, scheduler must
distribute the load uniformly between the physical packages. This
distribution will avoid scenarios in the system where one physical
package has more than one logical CPU busy and another physical
package is completely idle. Uniform load distribution between physical
packages will lead to lower resource contention and higher
throughput. Presence of Hyperthreading scheduler domain will help the
scheduler achieve the equal load distribution between the physical
packages.''

However, the article says that the kernel should support proper HT
scheduling, but my kernel does not do it.

It discusses 2.6.17 kernel, which is quite a bit older than my 2.6.24.

i
 
Joe...
Posted: Tue Oct 27, 2009 10:30 pm
Guest
On 2009-10-28, Ignoramus27237 <ignoramus27237 at (no spam) NOSPAM.27237.invalid> wrote:
Quote:
On 2009-10-28, DanS <t.h.i.s.n.t.h.a.t at (no spam) r.o.a.d.r.u.n.n.e.r.c.o.m> wrote:
Ignoramus27237 <ignoramus27237 at (no spam) NOSPAM.27237.invalid> wrote in
news:QtidnSTzfZ1mE3rXnZ2dnUVZ_tadnZ2d at (no spam) giganews.com:

I wrote a test perl script,

why would anyone use PERL for performance...


This was a test. The actual app is in C++. But a perl; script is a
much cleaner test because it is much simpler.

Then it?s not very representative of the actual task.

It may not be representative of the actual task, but it is not very
far.

I really do not want the discussion to stray into this area.

And what DO you want? You are using a kernel that predates your CPU.
It is NOT optimized to run on your CPU, and will NOT run optimally.
If you'd like to test the performance, test it on a kernel that has
been built and optimized for the CPU you are running it on.


--
Joe - Linux User #449481/Ubuntu User #19733
joe at hits - buffalo dot com
"Hate is baggage, life is too short to go around pissed off all the
time..." - Danny, American History X
 
 
Page 1 of 3    Goto page 1, 2, 3  Next
All times are GMT - 5 Hours
The time now is Tue Dec 01, 2009 3:56 pm