The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Matthew Dobson <colpatch@us.ibm.com>
To: Nick Piggin <piggin@cyberone.com.au>
Cc: Darren Hart <dvhltc@us.ibm.com>,
	LKML <linux-kernel@vger.kernel.org>,
	"Martin J. Bligh" <mbligh@aracnet.com>,
	Rick Lindsley <ricklind@us.ibm.com>,
	Andrew Morton <akpm@osdl.org>, Ingo Molnar <mingo@elte.hu>
Subject: Re: [patch] scheduler: rebalance_tick interval update
Date: Mon, 15 Nov 2004 17:53:13 -0800	[thread overview]
Message-ID: <1100569992.30259.20.camel@arrakis> (raw)
In-Reply-To: <4199550E.1030704@cyberone.com.au>

On Mon, 2004-11-15 at 17:17, Nick Piggin wrote:
> Darren Hart wrote:
> 
> >The current rebalance_tick() code assigns each sched_domain's
> >last_balance field to += interval after performing a load_balance.  If
> >interval is 10, this has the effect of saying:  we want to run
> >load_balance at time = 10, 20, 30, 40, etc...  If for example
> >last_balance=10 and for some reason rebalance_tick can't be run until
> >30, load_balance will be called and last_balance will be updated to 20,
> >causing it to call load_balance again immediately the next time it is
> >called since the interval is 10 and we are already at >30.  It seems to
> >me that it would make much more sense for last_balance to be assigned
> >jiffies after a load_balance, then the meaning of last_balance is more
> >exact: "this domain was last balanced at jiffies" rather than "we last
> >handled the balance we were supposed to do at 20, at some indeterminate
> >time".  The following patch makes this change.
> >
> >
> 
> Hi Darren,
> 
> This is how I first implemented it... but I think this will cause
> rebalance points of each processor to tend to become synchronised
> (rather than staggered) as ticks get lost.


But isn't that what this is supposed to stop:

        unsigned long j = jiffies + CPU_OFFSET(this_cpu);
....
                if (j - sd->last_balance >= interval) {
                        if (load_balance(this_cpu, this_rq, sd, idle)) {
                                /* We've pulled tasks over so no longer idle */
                                idle = NOT_IDLE;
                        }
                        sd->last_balance += interval;
                }

The CPU_OFFSET() macro is designed to spread out the balancing so they
don't all occur at the same time, no?

-Matt


  reply	other threads:[~2004-11-16  1:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-15 22:38 [patch] scheduler: rebalance_tick interval update Darren Hart
2004-11-16  1:17 ` Nick Piggin
2004-11-16  1:53   ` Matthew Dobson [this message]
2004-11-16  2:17     ` Nick Piggin
2004-11-16  2:27       ` Nick Piggin
2004-11-16  3:50         ` Darren Hart
2004-11-16  3:51       ` Darren Hart
2004-11-16  7:00       ` Rick Lindsley
     [not found]       ` <1100576400.14742.12.camel@farah.beaverton.ibm.com>
     [not found]         ` <4199957C.1020804@cyberone.com.au>
2004-11-16 15:56           ` Darren Hart
2004-11-18 16:22             ` Darren Hart

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=1100569992.30259.20.camel@arrakis \
    --to=colpatch@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=dvhltc@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbligh@aracnet.com \
    --cc=mingo@elte.hu \
    --cc=piggin@cyberone.com.au \
    --cc=ricklind@us.ibm.com \
    /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