All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <piggin@cyberone.com.au>
To: Ingo Molnar <mingo@elte.hu>
Cc: colpatch@us.ibm.com, linux-kernel <linux-kernel@vger.kernel.org>,
	Michael Hohnbaum <hohnbaum@us.ibm.com>
Subject: Re: [rfc][patch] kernel/sched.c oddness?
Date: Thu, 03 Oct 2002 18:32:52 +1000	[thread overview]
Message-ID: <3D9C00B4.8080502@cyberone.com.au> (raw)
In-Reply-To: Pine.LNX.4.44.0210030840110.4477-100000@localhost.localdomain


         * Make sure nothing changed since we checked the
         * runqueue length.
         */
-       if (busiest->nr_running <= nr_running + 1) {
+       if (busiest->nr_running <= nr_running) {
                spin_unlock(&busiest->lock);
                busiest = NULL;
        }

OK, thanks for the explanation, then disregard this part of the patch, the
other two are still valid I think.

Ingo Molnar wrote:

>>[...] However, I noticed on my 2xSMP system that quite unbalanced loads
>>weren't getting even CPU time best example - 3 processes in busywait
>>loops - one would get 100% of one cpu while two would get 50% each of
>>the other.
>>
>
>this was done intentionally, and this scenario (1+2 tasks) is the very
>worst scenario. The problem is that by trying to balance all 3 tasks we
>now have 3 tasks that trash their cache going from one CPU to another.  
>(this is what happens with your patch - even with another approach we'd
>have to trash at least one task)
>
>By keeping 2 tasks on one CPU and 1 task on the other CPU we avoid
>cross-CPU migration of threads. Think about the 2+3 or 4+5 tasks case
>rather, do we want absolutely perfect balancing, or good SMP affinity and
>good combined performance?
>
>	Ingo
>
>
>
>



  reply	other threads:[~2002-10-03  8:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-02 18:41 [rfc][patch] kernel/sched.c oddness? Matthew Dobson
2002-10-03  0:06 ` Nick Piggin
2002-10-03  0:30   ` Matthew Dobson
2002-10-03  6:54   ` Ingo Molnar
2002-10-03  8:32     ` Nick Piggin [this message]
2002-10-03 21:15     ` Matthew Dobson
2002-10-04  7:46       ` Ingo Molnar

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=3D9C00B4.8080502@cyberone.com.au \
    --to=piggin@cyberone.com.au \
    --cc=colpatch@us.ibm.com \
    --cc=hohnbaum@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.