From: "Simon Holm Thøgersen" <odie@cs.aau.dk>
To: Jie Chen <chen@jlab.org>
Cc: Eric Dumazet <dada1@cosmosbay.com>, linux-kernel@vger.kernel.org
Subject: Re: Possible bug from kernel 2.6.22 and above
Date: Thu, 22 Nov 2007 03:32:50 +0100 [thread overview]
Message-ID: <1195698770.11808.4.camel@odie.local> (raw)
In-Reply-To: <4744E0DC.7050808@jlab.org>
ons, 21 11 2007 kl. 20:52 -0500, skrev Jie Chen:
> Eric Dumazet wrote:
> > Jie Chen a écrit :
> >> Hi, there:
> >>
> >> We have a simple pthread program that measures the synchronization
> >> overheads for various synchronization mechanisms such as spin locks,
> >> barriers (the barrier is implemented using queue-based barrier
> >> algorithm) and so on. We have dual quad-core AMD opterons (barcelona)
> >> clusters running 2.6.23.8 kernel at this moment using Fedora Core 7
> >> distribution. Before we moved to this kernel, we had kernel 2.6.21.
> >> These two kernels are configured identical and compiled with the same
> >> gcc 4.1.2 compiler. Under the old kernel, we observed that the
> >> performance of these overheads increases as the number of threads
> >> increases from 2 to 8. The following are the values of total time and
> >> overhead for all threads acquiring a pthread spin lock and all threads
> >> executing a barrier synchronization call.
> >
> > Could you post the source of your test program ?
> >
>
>
> Hi, Eric:
>
> Thank you for the quick response. You can get the source code containing
> the test code from ftp://ftp.jlab.org/pub/hpc/qmt.tar.gz . This is a
> data parallel threading package for physics calculation. The test code
> is pthread_sync in the src directory once you unpack the gz file. To
> configure and build this package is very simple: configure and make. The
> test program is built by make check. The number of threads is
> controlled by QMT_NUM_THREADS. The package is using pthread spin lock,
> but the barrier is implemented using a queue-based barrier algorithm
> proposed by J. B. Carter of University of Utah (2005).
>
>
>
>
>
> > spinlock are ... spining and should not call linux scheduler, so I have
> > no idea why a kernel change could modify your results.
> >
> > Also I suspect you'll have better results with Fedora Core 8 (since
> > glibc was updated to use private futexes in v 2.7), at least for the
> > barrier ops.
> >
> >
>
> I am not sure what the biggest change between kernel 2.6.21 and 2.6.22
> (23) is? Is the scheduler the biggest change between these versions? Can
> the scheduler of kernel somehow effect the performance? I know the
> scheduler is trying to do load balance and so on. Can the scheduler move
> threads to different cores according to the load balance algorithm even
> though the threads are bound to cores using pthread_setaffinity_np call
> when the number of threads is fewer than the number of cores? I am
> thinking about this because the performance of our test code is roughly
> the same for both kernels when the number of threads equals to the
> number of cores.
>
There is a backport of the CFS scheduler to 2.6.21, see
http://lkml.org/lkml/2007/11/19/127
> >>
> >> Kernel 2.6.21
> >> Number of Threads 2 4 6 8
> >> SpinLock (Time micro second) 10.5618 10.58538 10.5915 10.643
> >> (Overhead) 0.073 0.05746 0.102805 0.154563
> >> Barrier (Time micro second) 11.020410 11.678125 11.9889 12.38002
> >> (Overhead) 0.531660 1.1502 1.500112 1.891617
> >>
> >> Each thread is bound to a particular core using pthread_setaffinity_np.
> >>
> >> Kernel 2.6.23.8
> >> Number of Threads 2 4 6 8
> >> SpinLock (Time micro second) 14.849915 17.117603 14.4496 10.5990
> >> (Overhead) 4.345417 6.617207 3.949435 0.110985
> >> Barrier (Time micro second) 19.462255 20.285117 16.19395 12.37662
> >> (Overhead) 8.957755 9.784722 5.699590 1.869518
> >>
> >> It is clearly that the synchronization overhead increases as the
> >> number of threads increases in the kernel 2.6.21. But the
> >> synchronization overhead actually decreases as the number of threads
> >> increases in the kernel 2.6.23.8 (We observed the same behavior on
> >> kernel 2.6.22 as well). This certainly is not a correct behavior. The
> >> kernels are configured with CONFIG_SMP, CONFIG_NUMA, CONFIG_SCHED_MC,
> >> CONFIG_PREEMPT_NONE, CONFIG_DISCONTIGMEM set. The complete kernel
> >> configuration file is in the attachment of this e-mail.
> >>
> >> From what we have read, there was a new scheduler (CFS) appeared from
> >> 2.6.22. We are not sure whether the above behavior is caused by the
> >> new scheduler.
> >>
> >> Finally, our machine cpu information is listed in the following:
> >>
> >> processor : 0
> >> vendor_id : AuthenticAMD
> >> cpu family : 16
> >> model : 2
> >> model name : Quad-Core AMD Opteron(tm) Processor 2347
> >> stepping : 10
> >> cpu MHz : 1909.801
> >> cache size : 512 KB
> >> physical id : 0
> >> siblings : 4
> >> core id : 0
> >> cpu cores : 4
> >> fpu : yes
> >> fpu_exception : yes
> >> cpuid level : 5
> >> wp : yes
> >> flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
> >> mca cmov
> >> pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt
> >> pdpe1gb rdtscp
> >> lm 3dnowext 3dnow constant_tsc rep_good pni cx16 popcnt lahf_lm
> >> cmp_legacy svm
> >> extapic cr8_legacy altmovcr8 abm sse4a misalignsse 3dnowprefetch osvw
> >> bogomips : 3822.95
> >> TLB size : 1024 4K pages
> >> clflush size : 64
> >> cache_alignment : 64
> >> address sizes : 48 bits physical, 48 bits virtual
> >> power management: ts ttp tm stc 100mhzsteps hwpstate
> >>
> >> In addition, we have schedstat and sched_debug files in the /proc
> >> directory.
> >>
> >> Thank you for all your help to solve this puzzle. If you need more
> >> information, please let us know.
> >>
> >>
> >> P.S. I like to be cc'ed on the discussions related to this problem.
> >>
>
> Thank you for your help and happy thanksgiving !
>
Simon Holm Thøgersen
next prev parent reply other threads:[~2007-11-22 2:26 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-21 20:34 Possible bug from kernel 2.6.22 and above Jie Chen
2007-11-21 22:14 ` Eric Dumazet
2007-11-22 1:52 ` Jie Chen
2007-11-22 2:32 ` Simon Holm Thøgersen [this message]
2007-11-22 2:58 ` Jie Chen
2007-11-22 20:19 ` Matt Mackall
2007-12-04 13:17 ` Possible bug from kernel 2.6.22 and above, 2.6.24-rc4 Ingo Molnar
2007-12-04 15:41 ` Jie Chen
2007-12-05 15:29 ` Jie Chen
2007-12-05 15:40 ` Ingo Molnar
2007-12-05 16:16 ` Eric Dumazet
2007-12-05 16:25 ` Ingo Molnar
2007-12-05 16:29 ` Eric Dumazet
2007-12-05 16:22 ` Jie Chen
2007-12-05 16:47 ` Ingo Molnar
2007-12-05 17:47 ` Jie Chen
2007-12-05 20:03 ` Ingo Molnar
2007-12-05 20:23 ` Jie Chen
2007-12-05 20:46 ` Ingo Molnar
2007-12-05 20:52 ` Jie Chen
2007-12-05 21:02 ` Ingo Molnar
2007-12-05 22:16 ` Jie Chen
2007-12-06 10:43 ` Ingo Molnar
2007-12-06 16:29 ` Jie Chen
2007-12-10 10:59 ` Ingo Molnar
2007-12-10 20:04 ` Jie Chen
2007-12-11 10:51 ` Ingo Molnar
2007-12-11 15:28 ` Jie Chen
2007-12-11 15:52 ` Ingo Molnar
2007-12-11 16:39 ` Jie Chen
2007-12-11 21:23 ` Ingo Molnar
2007-12-11 22:11 ` Jie Chen
2007-12-12 12:49 ` Peter Zijlstra
2007-12-05 20:36 ` Possible bug from kernel 2.6.22 and above Peter Zijlstra
2007-12-05 20:53 ` Jie Chen
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=1195698770.11808.4.camel@odie.local \
--to=odie@cs.aau.dk \
--cc=chen@jlab.org \
--cc=dada1@cosmosbay.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