The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Igor Chudov <ichudov@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: Hyperthreading on 4 core CPU DECREASES performance???
Date: Wed, 28 Oct 2009 14:24:53 -0500	[thread overview]
Message-ID: <e86b7d350910281224i7e91a1ecp9f3d15d9c36f19cb@mail.gmail.com> (raw)

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

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. I tried the same with 2.6.31,
with the same effect.

This article from Intel:

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

It talks about intelligent handling of multiple cores as a done deal,
but in my experience that did not actually occur.

I would like to know how can I make the scheduler to prefer to spread
the tasks across physical cores as opposed to bundling two on one core
and leaving some cores idle.

             reply	other threads:[~2009-10-28 19:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-28 19:24 Igor Chudov [this message]
2009-10-28 20:46 ` Hyperthreading on 4 core CPU DECREASES performance??? Andreas Mohr
2009-10-28 21:11   ` Igor Chudov
2009-10-28 22:24 ` Alan Cox
2009-10-29  0:00   ` Igor Chudov
2009-10-29  0:44     ` Ben Gamari

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=e86b7d350910281224i7e91a1ecp9f3d15d9c36f19cb@mail.gmail.com \
    --to=ichudov@gmail.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