All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: linux thread scheduling
@ 2012-02-10 22:44 Martin Rogge
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Rogge @ 2012-02-10 22:44 UTC (permalink / raw)
  To: Linux Kernel Mailing List

Xin Tong wrote:

> I have a program that spawns 3 threads and there is a great deal of
> sharing among the three threads. they all read/update a couple of
> shared variables.
> 
> I run this on nehalem (8 cores, 4 core in each physical package),  I
> find that running the 3 threads on core 0, 1, 2 (using
> pthread_setaffinitiy) gives much better results, this is because the
> cache coherency protocol performs much better on the same package.
> However, if  I leave Linux (Suse Enterprise) to schedule it. it gives
> much worse performance, i suspect that linux is scheduling the 3
> threads across the physical packages ( 2 on one package, 1 on
> another). Is this possible ? why does linux do this ?

the following paper on cpu schedulers was posted recently. Maybe it gives you 
a starting point.

http://research.cs.wisc.edu/wind/Publications/meehean-thesis11.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

* linux thread scheduling
@ 2012-02-09  2:45 Xin Tong
  0 siblings, 0 replies; 2+ messages in thread
From: Xin Tong @ 2012-02-09  2:45 UTC (permalink / raw)
  To: linux-kernel

I have a program that spawns 3 threads and there is a great deal of
sharing among the three threads. they all read/update a couple of
shared variables.

I run this on nehalem (8 cores, 4 core in each physical package),  I
find that running the 3 threads on core 0, 1, 2 (using
pthread_setaffinitiy) gives much better results, this is because the
cache coherency protocol performs much better on the same package.
However, if  I leave Linux (Suse Enterprise) to schedule it. it gives
much worse performance, i suspect that linux is scheduling the 3
threads across the physical packages ( 2 on one package, 1 on
another). Is this possible ? why does linux do this ?

Thanks

Xin

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-02-10 23:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-10 22:44 linux thread scheduling Martin Rogge
  -- strict thread matches above, loose matches on Subject: below --
2012-02-09  2:45 Xin Tong

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.