From: "David Schwartz" <davids@webmaster.com>
To: "Linux-Kernel@Vger. Kernel. Org" <linux-kernel@vger.kernel.org>
Subject: RE: some bad numbers with Java/database threading
Date: Thu, 13 Sep 2007 14:47:36 -0700 [thread overview]
Message-ID: <MDEHLPKNGKAHNMBLJOLKIEHLGMAC.davids@webmaster.com> (raw)
In-Reply-To: <46E9893C.1060709@nagafix.co.uk>
First, let me apologize if the tone of my other post came through as angry or frustrated. Text can sometimes be misleading as to tone. I certainly wasn't angry.
Second, let me say that I'm definitely not suggesting that you were wrong to bring this to everyone's attention. Even if it turns out that your code is horribly broken and it's all your fault, any apparent regression still has to be investigated. It is virtually certain that we will learn something interesting about either your code, CFS, or both.
I was definitely *not* saying "how dare you challenge CFS' supremacy without a perfect test case".
Antoine Martin wrote:
> >> Now, even if they're using separate tables, your test is still very
> >> sensitive to execution order. If thread A runs to completion and then
> >> thread B does, the database data will fit better into cache.
> >> If thread A
> >> runs partially, then thread B runs partially, when thread A
> >> runs again, its
> >> database stuff will not be hot.
> You are correct, it is very sensitive to the execution order and
> caching. When I vary the thread pause, the total execution time varies
> widely. 10ms just happens to be the sweet spot which provides the best
> contrast in the results (for both kernels and rdbms)
> >> Or is
> >> there some sane reason to force suboptimal scheduling when
> >> you're trying to
> >> benchmark a scheduler? Are you trying to see how it deals with
> >> pathological
> >> patterns? ;)
> I know it sounds sub-optimal, but this benchmark wasn't designed to test
> the scheduler! It is meant to thrash just one database table. It isn't
> meant to be anything like TPC either.
> Previously it did uncover some very noticeable differences in JVM
> performance when stress-tested with a large amount of threads.
The problem is that because your access pattern is pathological, schedulers that are objectively worse may turn in much better performance. For example, a scheduler that completely ignores your attempt to sleep will probably perform significantly better than a scheduler that goes out of its way to honor it.
That the execution time is very sensitive to the pause is strong evidence of this.
The problem is simply that your test program doesn't do a fixed amount of work. It does a variable amount of work, and that amount depends upon scheduler details. It's like a job that has fifty threads that do this:
1) Increment a shared variable.
2) Do a math problem a number of times equal to the value of that shared variable.
3) Decrement the shared variable.
The problem is that the number of times the math problem is done depends upon the execution order of the threads. To be fair, you would need to benchmark how many times the math problem gets done, not how long the threads take to complete.
Now, imagine if I insert a yield between steps 1 and 2. The more a scheduler honors your yield request, the worse it will appear to perform. The scheduler that ignores it (which is legal, but definitely not The Right Thing) will seem to perform *much* better.
Of course, it's also possible that this is not what's going on.
DS
next prev parent reply other threads:[~2007-09-13 21:48 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-12 23:10 CFS: " Antoine Martin
2007-09-13 7:18 ` David Schwartz
2007-09-12 23:33 ` Nick Piggin
2007-09-13 19:02 ` Antoine Martin
2007-09-13 21:47 ` David Schwartz [this message]
2007-09-13 11:24 ` CFS: " Ingo Molnar
2007-09-14 8:32 ` Ingo Molnar
2007-09-14 10:06 ` Satyam Sharma
2007-09-14 15:25 ` CFS: some bad numbers with Java/database threading [FIXED] Antoine Martin
2007-09-14 15:32 ` Ingo Molnar
2007-09-18 17:00 ` Chuck Ebbert
2007-09-18 22:46 ` Ingo Molnar
2007-09-18 23:02 ` Chuck Ebbert
2007-09-19 18:45 ` David Schwartz
2007-09-19 19:48 ` Chris Friesen
2007-09-19 22:56 ` David Schwartz
2007-09-19 23:05 ` David Schwartz
2007-09-19 23:52 ` David Schwartz
2007-09-19 19:18 ` Ingo Molnar
2007-09-19 19:39 ` Linus Torvalds
2007-09-19 19:56 ` Ingo Molnar
2007-09-19 20:26 ` Ingo Molnar
2007-09-19 20:28 ` Linus Torvalds
2007-09-19 21:41 ` Ingo Molnar
2007-09-19 21:49 ` Ingo Molnar
2007-09-19 21:58 ` Peter Zijlstra
2007-09-26 1:46 ` CFS: new java yield graphs Antoine Martin
2007-09-27 8:35 ` Ingo Molnar
2007-09-19 20:00 ` CFS: some bad numbers with Java/database threading [FIXED] Chris Friesen
2007-09-14 16:01 ` CFS: some bad numbers with Java/database threading Satyam Sharma
2007-09-14 16:08 ` Satyam Sharma
2007-09-17 12:17 ` Antoine Martin
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=MDEHLPKNGKAHNMBLJOLKIEHLGMAC.davids@webmaster.com \
--to=davids@webmaster.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
all inboxes | Powered by JetHome®