RE: RSDL-mm 0.28

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: David Schwartz
Date: Monday, March 12, 2007 - 6:22 am

> > There's a substantial performance hit for not yield, so we probably


The basic point of sched_yield is to allow every other process at the same
static priority level a chance to use the CPU before you get it back. It is
generally an error to use sched_yield to be nice. It's nice to get your work
done when the scheduler gives you the CPU, that's why it gave it to you.

It is proper to use sched_yield as an optimization when it more efficient to
allow another process/thread to run than you, for example, when you
encounter a task you cannot do efficiently at that time because another
thread holds a lock.

It's also useful prior to doing something that can most efficiently be done
without interruption. So a thread that returns from 'sched_yield' should
ideally be given a full timeslice if possible. This may not be sensible if
the 'sched_yield' didn't actuall yield, but then again, if nothing else
wants to run, why not give the only task that does a full slice?

In no case is much of anything guaranteed, of course. (What can you do if
there's no other process to yield to?)

Note that processes that call sched_yield should be rewarded for doing so
just as process that block on I/O are, assuming they do in fact wind up
giving up the CPU when they would otherwise have had it.

DS


-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
RSDL-mm 0.28, Matt Mackall, (Sat Mar 10, 6:35 pm)
Re: RSDL-mm 0.28, Con Kolivas, (Sat Mar 10, 7:28 pm)
Re: RSDL-mm 0.28, Andrew Morton, (Sat Mar 10, 8:16 pm)
Re: RSDL-mm 0.28, Andrew Morton, (Sat Mar 10, 8:39 pm)
Re: RSDL-mm 0.28, William Lee Irwin III, (Sat Mar 10, 8:43 pm)
Re: RSDL-mm 0.28, Con Kolivas, (Sat Mar 10, 8:44 pm)
Re: RSDL-mm 0.28, Con Kolivas, (Sat Mar 10, 8:59 pm)
Re: RSDL-mm 0.28, Matt Mackall, (Sat Mar 10, 9:01 pm)
Re: RSDL-mm 0.28, Matt Mackall, (Sat Mar 10, 9:03 pm)
Re: RSDL-mm 0.28, Con Kolivas, (Sat Mar 10, 11:19 pm)
Re: RSDL-mm 0.28, Willy Tarreau, (Sun Mar 11, 12:32 am)
Re: RSDL for 2.6.21-rc3- 0.29, Gene Heskett, (Sun Mar 11, 10:38 pm)
Re: RSDL for 2.6.21-rc3- 0.29, Con Kolivas, (Sun Mar 11, 10:48 pm)
Re: RSDL for 2.6.21-rc3- 0.29, Gene Heskett, (Sun Mar 11, 11:37 pm)
Re: RSDL for 2.6.21-rc3- 0.29, Gene Heskett, (Mon Mar 12, 3:04 am)
Re: RSDL for 2.6.21-rc3- 0.29, Douglas McNaught, (Mon Mar 12, 5:51 am)
RE: RSDL-mm 0.28, David Schwartz, (Mon Mar 12, 6:22 am)
Re: RSDL-mm 0.28, Ray Lee, (Mon Mar 12, 7:54 am)
Re: RSDL for 2.6.21-rc3- 0.29, Gene Heskett, (Mon Mar 12, 11:28 am)
Re: RSDL for 2.6.21-rc3- 0.29, Douglas McNaught, (Mon Mar 12, 11:46 am)
Re: RSDL for 2.6.21-rc3- 0.29, Gene Heskett, (Mon Mar 12, 12:10 pm)
Re: RSDL for 2.6.21-rc3- 0.29, Lee Revell, (Mon Mar 12, 12:14 pm)
Re: RSDL for 2.6.21-rc3- 0.29, Douglas McNaught, (Mon Mar 12, 12:43 pm)
Re: RSDL for 2.6.21-rc3- 0.29, Patrick Mau, (Mon Mar 12, 12:54 pm)
Re: RSDL for 2.6.21-rc3- 0.29, Gene Heskett, (Mon Mar 12, 1:24 pm)
Stracing Amanda (was: RSDL for 2.6.21-rc3- 0.29), Douglas McNaught, (Mon Mar 12, 6:32 pm)
Re: Stracing Amanda (was: RSDL for 2.6.21-rc3- 0.29), Gene Heskett, (Mon Mar 12, 7:39 pm)
Re: Stracing Amanda (was: RSDL for 2.6.21-rc3- 0.29), Nish Aravamudan, (Mon Mar 12, 8:01 pm)
Re: Stracing Amanda (was: RSDL for 2.6.21-rc3- 0.29), Gene Heskett, (Mon Mar 12, 9:04 pm)
Re: Stracing Amanda (was: RSDL for 2.6.21-rc3- 0.29), Willy Tarreau, (Mon Mar 12, 9:45 pm)
Re: Stracing Amanda (was: RSDL for 2.6.21-rc3- 0.29), Gene Heskett, (Mon Mar 12, 10:48 pm)
Re: RSDL-mm 0.28, Nick Piggin, (Tue Mar 13, 12:22 am)