From: Linus Torvalds <torvalds@linux-foundation.org>
To: Nick Piggin <npiggin@suse.de>
Cc: Ingo Molnar <mingo@elte.hu>,
Andrew Morton <akpm@linux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: lmbench ctxsw regression with CFS
Date: Wed, 1 Aug 2007 19:31:26 -0700 (PDT) [thread overview]
Message-ID: <alpine.LFD.0.999.0708011922500.3582@woody.linux-foundation.org> (raw)
In-Reply-To: <20070802021525.GC15595@wotan.suse.de>
On Thu, 2 Aug 2007, Nick Piggin wrote:
>
> lmbench 3 lat_ctx context switching time with 2 processes bound to a
> single core increases by between 25%-35% on my Core2 system (didn't do
> enough runs to get more significance, but it is around 30%). The problem
> bisected to the main CFS commit.
One thing to check out is whether the lmbench numbers are "correct".
Especially on SMP systems, the lmbench numbers are actually *best* when
the two processes run on the same CPU, even though that's not really at
all the best scheduling - it's just that it artificially improves lmbench
numbers because of the close cache affinity for the pipe data structures.
So when running the lmbench scheduling benchmarks on SMP, it actually
makes sense to run them *pinned* to one CPU, because then you see the true
scheduler performance. Otherwise you easily get noise due to balancing
issues, and a clearly better scheduler can in fact generate worse
numbers for lmbench.
Did you do that? It's at least worth testing. I'm not saying it's the case
here, but it's one reason why lmbench3 has the option to either keep
processes on the same CPU or force them to spread out (and both cases are
very interesting for scheduler testing, and tell different things: the
"pin them to the same CPU" shows the latency on one runqueue, while the
"pin them to different CPU's" shows the latency of a remote wakeup).
IOW, while we used the lmbench scheduling benchmark pretty extensively in
early scheduler tuning, if you select the defaults ("let the system just
schedule processes on any CPU") the end result really isn't necessarily a
very meaningful value: getting the best lmbench numbers actually requires
you to do things that tend to be actively *bad* in real life.
Of course, a perfect scheduler would notice when two tasks are *so*
closely related and only do synchronous wakups, that it would keep them on
the same core, and get the best possible scores for lmbench, while not
doing that for other real-life situations. So with a *really* smart
scheduler, lmbench numbers would always be optimal, but I'm not sure
aiming for that kind of perfection is even worth it!
Linus
next prev parent reply other threads:[~2007-08-02 2:31 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-02 2:15 Nick Piggin
2007-08-02 2:31 ` Linus Torvalds [this message]
2007-08-02 2:41 ` Nick Piggin
2007-08-02 7:19 ` Ingo Molnar
2007-08-02 7:31 ` Nick Piggin
2007-08-02 15:44 ` Ingo Molnar
2007-08-03 0:14 ` Nick Piggin
2007-08-04 6:50 ` Ingo Molnar
2007-08-06 3:29 ` Nick Piggin
2007-08-13 12:30 ` Jens Axboe
2007-08-14 3:00 ` Andrew Morton
2007-08-14 3:23 ` Nick Piggin
2007-08-16 21:28 ` Siddha, Suresh B
2007-08-14 3:25 ` David Miller
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=alpine.LFD.0.999.0708011922500.3582@woody.linux-foundation.org \
--to=torvalds@linux-foundation.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=npiggin@suse.de \
/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
all inboxes | Powered by JetHome®