All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Pilarski <thomas.pi@arcor.de>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Mike Galbraith <efault@gmx.de>,
	Gregory Haskins <ghaskins@novell.com>,
	bugme-daemon@bugzilla.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [Bugme-new] [Bug 12562] New: High overhead while switching or synchronizing threads on different cores
Date: Thu, 29 Jan 2009 15:05:34 +0100	[thread overview]
Message-ID: <1233237934.11129.183.camel@bugs-laptop> (raw)
In-Reply-To: <1233229028.4495.34.camel@laptop>


> In short this program is carefully crafted to defeat all our affinity
> tests - and I'm not sure what to do.

I am sorry, although it is not carefully crafted. The function random()
is causing my problem. I currently have no real data, so I tried to make
some random utilization and data.

Without the random() function it works even with 80MB of data and I get
great results.

./ThreadSchedulingIssue 1 10485760 8 312
All threads finished: 309 messages in 29.369 seconds / 10.521 msg/s

schedtool -a 1 -e ./ThreadSchedulingIssue 1 10485760 8 312
All threads finished: 312 messages in 44.284 seconds / 7.045 msg/s

It does not even regress with more then two threads. 

./ThreadSchedulingIssue 2 10485760 8 312
All threads finished: 311 messages in 28.040 seconds / 11.091 msg/s

./ThreadSchedulingIssue 4 10485760 8 312
All threads finished: 309 messages in 28.021 seconds / 11.027 msg/s

With small amounts of data the speed on two core is even doubled. 

schedtool -a 1 -e ./ThreadSchedulingIssue 1 1048 8 312000
All threads finished: 311992 messages in 19.437 seconds / 16051.247
msg/s

./ThreadSchedulingIssue 3 1048 8 312000
All threads finished: 311998 messages in 9.652 seconds / 32324.411 msg/s

./ThreadSchedulingIssue 8 1048 8 312000
All threads finished: 311997 messages in 9.339 seconds / 33406.370 msg/s

--------------
Perhaps it is as it should be, but when I run the test (without
random()) with 2*8 threads, it uses ~186 of the cpu, while an instance
of "bzip2 -9 -c /dev/urandom >/dev/null" gets only 12%.


  reply	other threads:[~2009-01-29 14:05 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-12562-10286@http.bugzilla.kernel.org/>
2009-01-28 20:56 ` [Bugme-new] [Bug 12562] New: High overhead while switching or synchronizing threads on different cores Andrew Morton
2009-01-28 22:15   ` Peter Zijlstra
2009-01-28 22:25   ` Thomas Pilarski
2009-01-29  9:07     ` Peter Zijlstra
2009-01-29 10:12       ` Thomas Pilarski
2009-01-29 10:24         ` Thomas Pilarski
2009-01-29 10:31           ` Peter Zijlstra
2009-01-29 11:37           ` Peter Zijlstra
2009-01-29 14:05             ` Thomas Pilarski [this message]
2009-01-30  7:57               ` Mike Galbraith
2009-02-02  7:43                 ` Thomas Pilarski
2009-02-02  8:19                   ` Peter Zijlstra
2009-02-02  8:33                     ` Thomas Pilarski
2009-02-02  8:52                       ` Mike Galbraith
2009-02-02  8:55                         ` Peter Zijlstra
2009-02-02 12:15                           ` Peter Zijlstra
2009-02-02 18:29                             ` Michael Kerrisk
2009-02-02 18:35                               ` Peter Zijlstra
2009-02-03  4:55                                 ` Mike Galbraith
2009-02-03  3:56                   ` Valdis.Kletnieks

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=1233237934.11129.183.camel@bugs-laptop \
    --to=thomas.pi@arcor.de \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=bugme-daemon@bugzilla.kernel.org \
    --cc=efault@gmx.de \
    --cc=ghaskins@novell.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.