Messages in this thread | | | Date | Thu, 12 Apr 2007 23:27:22 +1000 | From | Nick Piggin <> | Subject | Re: sched_yield proposals/rationale |
| |
Buytaert_Steven@emc.com wrote: >>-----Original Message----- >>From: Andi Kleen >>[ ... about use of sched_yield ...] >>On the other hand when they fix their code to not rely on sched_yield >>but use [...] > > > Agreed, but $ find . -name "*.[ch]" | xargs grep -E "yield[ ]*\(" | wc over > the 2.6.16 kernel yields 105 hits, note including comments...
Most of these (in core code, anyway) seem to use yield when they really don't care about running for a while.
> An interesting spot is e.g. fs/buffer.c free_more_memory()
This one should be pretty rare (actually I think it is dead code in practice, due to the way the page allocator works).
Avoiding sched_yield is a really good idea outside realtime scheduling. Since we have gone this far with the current semantics, I think it would be sad to back down now.
It would be nice if you could pressure those other components to adapt :)
-- SUSE Labs, Novell Inc. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |