From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Ingo Molnar <mingo@elte.hu>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Chuck Ebbert <cebbert@redhat.com>,
Antoine Martin <antoine@nagafix.co.uk>,
Satyam Sharma <satyam.sharma@gmail.com>,
Linux Kernel Development <linux-kernel@vger.kernel.org>
Subject: Re: CFS: some bad numbers with Java/database threading [FIXED]
Date: Wed, 19 Sep 2007 23:58:14 +0200 [thread overview]
Message-ID: <20070919235814.4147f574@lappy> (raw)
In-Reply-To: <20070919214105.GA12245@elte.hu>
On Wed, 19 Sep 2007 23:41:05 +0200 Ingo Molnar <mingo@elte.hu> wrote:
>
> * Linus Torvalds <torvalds@linux-foundation.org> wrote:
>
> > Btw, the "enqueue at the end" could easily be a statistical thing, not
> > an absolute thing. So it's possible that we could perhaps implement
> > the CFS "yield()" using the same logic as we have now, except *not*
> > calling the "update_stats()" stuff:
> >
> > __dequeue_entity(..);
> > __enqueue_entity(..);
> >
> > and then just force the "fair_key" of the to something that
> > *statistically* means that it should be at the end of its nice queue.
> >
> > I dunno.
>
> i thought a bit about the statistical approach, and it's good in
> principle, but it has an implementational problem/complication: if there
> are only yielding tasks in the system, then the "queue rightwards in the
> tree, statistically" approach cycles through the key-space artificially
> fast. That can cause various problems. (this means that the
> workload-flag patch that uses yield_granularity is buggy as well. The
> queue-rightmost patch did not have this problem.)
>
> So right now there are only two viable options i think: either do the
> current weak thing, or do the rightmost thing. The statistical method
> might work too, but it needs more thought and more testing - i'm not
> sure we can get that ready for 2.6.23.
>
> So what we have as working code right now is the two extremes, and apps
> will really mostly prefer either the first (if they dont truly want to
> use yield but somehow it got into their code) or the second (if they
> want some massive delay). So while it does not have a good QoI, how
> about doing a compat_yield sysctl that allows the turning on of the
> "queue rightmost" logic? Find tested patch below.
>
> Peter, what do you think?
I have to agree that for .23 we can't do much more than this. And tasks
moving to the right without actually doing work and advancing
fair_clock do scare me a little.
Also, while I agree with Linus' definition of sched_yield, I'm afraid
it will cause 'regressions' for all the interactivity people out there.
Somehow this yield thing has made it into all sorts of unfortunate
places like video drivers, so a heavy penalizing yield will hurt them.
next prev parent reply other threads:[~2007-09-19 22:00 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-12 23:10 CFS: some bad numbers with Java/database threading 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
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 [this message]
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=20070919235814.4147f574@lappy \
--to=a.p.zijlstra@chello.nl \
--cc=antoine@nagafix.co.uk \
--cc=cebbert@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=satyam.sharma@gmail.com \
--cc=torvalds@linux-foundation.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.