linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* sys_sched_yield fast path
@ 2001-03-10  0:47 Mike Kravetz
  2001-03-10 11:30 ` Davide Libenzi
  0 siblings, 1 reply; 10+ messages in thread
From: Mike Kravetz @ 2001-03-10  0:47 UTC (permalink / raw)
  To: linux-kernel

Any thoughts about adding a 'fast path' to the SMP code in
sys_sched_yield.  Why not compare nr_pending to smp_num_cpus
before examining the aligned_data structures?  Something like,

if (nr_pending > smp_num_cpus)
	goto set_resched_now;

Where set_resched_now is a label placed just before the code
that sets the need_resched field of the current process.
This would eliminate touching all the aligned_data cache lines
in the case where nr_pending can never be decremented to zero.

Also, would it make sense to stop decrementing nr_pending to
prevent it from going negative?  OR  Is the reasoning that in
these cases there is so much 'scheduling' activity that we
should force the reschedule?

-- 
Mike Kravetz                                 mkravetz@sequent.com
IBM Linux Technology Center

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2001-03-12  1:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).