public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: "Zhang, Yanmin" <yanmin_zhang@linux.intel.com>,
	Arjan van de Ven <arjan@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: sched_yield: delete sysctl_sched_compat_yield
Date: Mon, 3 Dec 2007 12:37:16 +0100	[thread overview]
Message-ID: <20071203113716.GA8432@elte.hu> (raw)
In-Reply-To: <200712032202.37975.nickpiggin@yahoo.com.au>


* Nick Piggin <nickpiggin@yahoo.com.au> wrote:

> > given how poorly sched_yield() is/was defined the only "compatible" 
> > solution would be to go back to the old yield code.
> 
> While it is technically allowed to do anything with SCHED_OTHER class, 
> putting the thread to the back of the runnable tasks, or at least 
> having it give up _some_ priority (like the old scheduler) is less 
> surprising than having it do _nothing_.

wrong: it's not "nothing" that the new code does - run two yield-ing 
loops and they'll happily switch to each other, at a rate of a few 
million context switches per second.

( Note that the old scheduler's yield code did not actually change a 
  task's priority - so if an interactive task (such as firefox) yielded, 
  it got different behavior than CPU hogs. )

> Wheras JVMs (eg. that have garbage collectors call yield), presumably 
> get quite a lot of tuning, and that was probably done with the less 
> surprising (and more common) sched_yield behaviour.

i disagree. To some of them, having a _more_ agressive yield than 2.6.22 
might increase latencies and jitter - which can be seen as a regression 
as well. All tests i've seen so far show dramatically lower jitter in 
v2.6.23 and upwards kernels.

anyway, right now what we have is a closed-source benchmark (which is a 
quite silly one as well) against a popular open-source desktop app and 
in that case the choice is obvious. Actual Java app server benchmarks 
did not show any regression so maybe Java's use of yield for locking is 
not that significant after all and it's only Volanomark that is doing 
extra (unnecessary) yields. (and java benchmarks are part of the 
upstream kernel test grid anyway so we'd have noticed any serious 
regression)

if you insist on flipping the default then that just shows a blatant 
disregard to desktop performance - i personally care quite a bit about 
desktop performance. (and deterministic scheduling in particular)

> > i think the sanest long-term solution is to strongly discourage the 
> > use of SCHED_OTHER::yield, because there's just no sane definition 
> > for yield that apps could rely upon. (well Linus suggested a pretty 
> > sane definition but that would necessiate the burdening of the 
> > scheduler fastpath - we dont want to do that.) New ideas are welcome 
> > of course.
> 
> sched_yield is defined to put the calling task at the end of the queue 
> for the given priority level as you know (ie. at the end of all other 
> priority 0 tasks, for SCHED_OTHER).

almost: substitute "priority" with "nice level". One problem is, that's 
not what the old scheduler did.

> > [ also, actual technical feedback on the SCHED_BATCH patch i sent
> >   (which was the only "forward looking" moment in this thread so far
> >    ;-) would be nice too. ]
> 
> I dislike a wholesale change in behaviour like that. Especially when 
> it is changing behaviour of yield among SCHED_BATCH tasks versus yield 
> among SCHED_OTHER tasks.

There's no wholesale change in behavior, SCHED_BATCH tasks have clear 
expectations of being throughput versus latency, hence the patch makes 
quite a bit of sense to me. YMMV.

	Ingo

  reply	other threads:[~2007-12-03 11:37 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-27  9:33 sched_yield: delete sysctl_sched_compat_yield Zhang, Yanmin
2007-11-27 11:17 ` Ingo Molnar
2007-11-27 22:57 ` Arjan van de Ven
2007-11-30  2:46   ` Nick Piggin
2007-11-30  2:51     ` Arjan van de Ven
2007-11-30  3:02       ` Nick Piggin
2007-11-30  3:15     ` Zhang, Yanmin
2007-11-30  3:29       ` Nick Piggin
2007-11-30  4:32         ` Zhang, Yanmin
2007-11-30 10:08         ` Ingo Molnar
2007-12-03  4:27           ` Nick Piggin
2007-12-03  8:45             ` Ingo Molnar
2007-12-03  9:17               ` Nick Piggin
2007-12-03  9:35                 ` Zhang, Yanmin
2007-12-03  9:57                 ` Ingo Molnar
2007-12-03 10:15                   ` Nick Piggin
2007-12-03 10:33                     ` Ingo Molnar
2007-12-03 11:02                       ` Nick Piggin
2007-12-03 11:37                         ` Ingo Molnar [this message]
2007-12-03 17:04                           ` David Schwartz
2007-12-03 17:37                             ` Chris Friesen
2007-12-03 19:12                               ` David Schwartz
2007-12-03 19:56                                 ` Chris Friesen
2007-12-03 21:39                                   ` Mark Lord
2007-12-03 21:48                                     ` Ingo Molnar
2007-12-03 21:57                                       ` Mark Lord
2007-12-03 22:05                                         ` Ingo Molnar
2007-12-03 22:18                                           ` Mark Lord
2007-12-03 22:33                                             ` Ingo Molnar
2007-12-04  0:18                                               ` Nick Piggin
2007-12-04  0:30                                           ` David Schwartz
2007-12-04  2:09                                             ` Nick Piggin
2007-12-04  1:02                           ` Nick Piggin
2007-12-03  9:41               ` Zhang, Yanmin
2007-12-03 10:17                 ` Ingo Molnar
2007-12-03  9:29           ` Zhang, Yanmin
2007-12-03 10:05             ` Ingo Molnar
2007-12-04  6:40               ` Zhang, Yanmin

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=20071203113716.GA8432@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickpiggin@yahoo.com.au \
    --cc=yanmin_zhang@linux.intel.com \
    /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