Re: sched_yield() makes OpenLDAP slow

From: Nick Piggin
Date: Wed Aug 17 2005 - 21:59:12 EST


Joseph Fannin wrote:

On Thu, Aug 18, 2005 at 02:50:16AM +0200, Bernardo Innocenti wrote:


The relative timestamp reveals that slapd is spending 50ms
after yielding. Meanwhile, GCC is probably being scheduled
for a whole quantum.

Reading the man-page of sched_yield() it seems this isn't
the correct behavior:

Note: If the current process is the only process in the
highest priority list at that time, this process will
continue to run after a call to sched_yield.


The behavior of sched_yield changed for 2.6. I suppose the man
page didn't get updated.



We class the SCHED_OTHER policy as having a single priority, which
I believe is allowed (and even makes good sense, because dynamic
and even nice priorities aren't really well defined).

That also makes our sched_yield() behaviour correct.

AFAIKS, sched_yield should only really be used by realtime
applications that know exactly what they're doing.


Send instant messages to your online friends http://au.messenger.yahoo.com -
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/