linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Kravetz <mkravetz@sequent.com>
To: linux-kernel@vger.kernel.org
Subject: sys_sched_yield fast path
Date: Fri, 9 Mar 2001 16:47:41 -0800	[thread overview]
Message-ID: <20010309164740.D1057@w-mikek2.sequent.com> (raw)

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

             reply	other threads:[~2001-03-10  0:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-10  0:47 Mike Kravetz [this message]
2001-03-10 11:30 ` sys_sched_yield fast path 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

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=20010309164740.D1057@w-mikek2.sequent.com \
    --to=mkravetz@sequent.com \
    --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;
as well as URLs for NNTP newsgroup(s).