mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Leon Woestenberg" <leon.woestenberg@gmail.com>
To: 7eggert@gmx.de
Cc: "Peter Zijlstra" <a.p.zijlstra@chello.nl>,
	"Jakub Jozwicki" <jozwicki@aster.pl>,
	linux-kernel@vger.kernel.org, "Robert Hancock" <hancockr@shaw.ca>
Subject: Re: sched_yield() on 2.6.25
Date: Thu, 12 Jun 2008 00:45:13 +0200	[thread overview]
Message-ID: <c384c5ea0806111545g6e6128bek519ce6022a301339@mail.gmail.com> (raw)
In-Reply-To: <20080611152807.0682218F62@be1.lrz>

Hello,

On Wed, Jun 11, 2008 at 5:28 PM, Bodo Eggert <7eggert@gmx.de> wrote:
> Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
>> On Mon, 2008-06-09 at 08:37 +0200, Jakub Jozwicki wrote:
>
>>> From the man sched_yield:
>>>
>>> A  process  can  relinquish  the  processor  voluntarily without blocking by
>>> calling sched_yield().  The process will then be moved to the  end  of  the
>>> queue  for  its static priority and a new process gets to run.
>>>
>>> and also IEEE/Open Group:
>>> http://www.opengroup.org/onlinepubs/000095399/functions/sched_yield.html
>>
>> Yeah, except that is for Real-Time scheduling classes, SCHED_OTHER
>> doesn't have static priority queues.
>>
>> SCHED_OTHER doesn't have a specified implementation - so relying on it
>> to do anything specific is well outside the scope of definition.
>
> OTOH, it's sane not to schedule exactly the thread which just tried
> to say "I can't do any sane work, please run another thread.
>
That's not the definition of sched_yield(). See the earlier emails,
and the quote above.

As the code after sched_yield() has to be executed the thread will be
rescheduled soon (or even immediately) anyway.

The users not understanding the limited scope where sched_yield()
behaves deterministicly, seem to think that _yield() will yield() AND
lower the thread's dynamic priority for SCHED_OTHER. Is downgrading
the dynamic priority a behavioral option?

On the other hand, I don't think anything should encourage the use of
sched_yield() outside of the rare SCHED_FIFO/RR case.

Regards,
-- 
Leon

  reply	other threads:[~2008-06-11 22:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <aCBfw-3Cv-23@gated-at.bofh.it>
     [not found] ` <aCBfw-3Cv-21@gated-at.bofh.it>
     [not found]   ` <aCJd6-3IF-11@gated-at.bofh.it>
     [not found]     ` <aCRaM-8cM-33@gated-at.bofh.it>
2008-06-11 15:28       ` Bodo Eggert
2008-06-11 22:45         ` Leon Woestenberg [this message]
2008-06-12  8:09           ` Helge Hafting
2008-06-12 22:33           ` Bodo Eggert
2008-06-13  8:37             ` Helge Hafting
     [not found] <fa.5iKTy3xTJkKWZLGio+GIHXi3+0o@ifi.uio.no>
2008-06-08 22:09 ` Robert Hancock
2008-06-09  6:37   ` Jakub Jozwicki
2008-06-09  9:03     ` Helge Hafting
2008-06-09 15:04     ` Peter Zijlstra
2008-06-08 11:34 Jakub W. Jozwicki
2008-06-09  9:35 ` Andrew Morton

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=c384c5ea0806111545g6e6128bek519ce6022a301339@mail.gmail.com \
    --to=leon.woestenberg@gmail.com \
    --cc=7eggert@gmx.de \
    --cc=a.p.zijlstra@chello.nl \
    --cc=hancockr@shaw.ca \
    --cc=jozwicki@aster.pl \
    --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®