From: Anton Blanchard <anton@linuxcare.com.au>
To: Davide Libenzi <davidel@xmailserver.org>
Cc: linux-kernel@vger.kernel.org, Andi Kleen <ak@suse.de>
Subject: Re: sys_sched_yield fast path
Date: Mon, 12 Mar 2001 12:24:47 +1100 [thread overview]
Message-ID: <20010312122447.A7350@linuxcare.com> (raw)
In-Reply-To: <20010312005448.A5439@linuxcare.com> <XFMail.20010312011030.davidel@xmailserver.org>
In-Reply-To: <XFMail.20010312011030.davidel@xmailserver.org>; from davidel@xmailserver.org on Mon, Mar 12, 2001 at 01:10:30AM +0100
Hi,
> 2.4.x has changed the scheduler behaviour so that the task that call
> sched_yield() is not rescheduled by the incoming schedule(). A flag is
> set ( under certain conditions in SMP ) and the goodness() calculation
> assign the lower value to the exiting task ( this flag is cleared in
> schedule_tail() ).
The behaviour I am talking about is when there is a heavily contended
spinlock, and more than one task is trying to obtain it. Since SCHED_YIELD
only changes the goodness when we are trying to reschedule the task we
can bounce between two or more tasks doing sched_yield() for a while before
finally running the task that has the spinlock.
Of course with short lived spinlocks you should rarely get the case where
a task grabs a spinlock just before its timeslice is up, so maybe the answer
is just to spin a few times on sched_yield() then back off to nanosleep()
like pthreads does.
Anton
prev parent reply other threads:[~2001-03-12 1:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-10 0:47 sys_sched_yield fast path Mike Kravetz
2001-03-10 11:30 ` Davide Libenzi
2001-03-10 16:59 ` Andi Kleen
2001-03-11 14:12 ` Davide Libenzi
2001-03-11 13:54 ` Anton Blanchard
2001-03-11 19:17 ` Dave Zarzycki
2001-03-12 0:18 ` Davide Libenzi
2001-03-11 23:46 ` Davide Libenzi
2001-03-12 0:10 ` Davide Libenzi
2001-03-12 1:24 ` Anton Blanchard [this message]
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=20010312122447.A7350@linuxcare.com \
--to=anton@linuxcare.com.au \
--cc=ak@suse.de \
--cc=davidel@xmailserver.org \
--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