mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Jason Low <jason.low2@hp.com>
Cc: Ingo Molnar <mingo@redhat.com>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH v3] sched: Limit idle balance based on max cost per sched domain
Date: Thu, 22 Aug 2013 13:10:27 +0200	[thread overview]
Message-ID: <20130822111027.GJ31370@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <1376991166.1753.8.camel@j-VirtualBox>

On Tue, Aug 20, 2013 at 02:32:46AM -0700, Jason Low wrote:
> Hi Peter,
> 
> So this is my sample implementation of the concept of matching the CPU's avg_idle 
> with the maximum time we ever spend in a new idle load balance for each domain.
> This is based on our previous patch which compares avg_idle with sd->avg_cost,
> but I replaced sd->avg_cost with sd->max_cost.
> 
> Since we are comparing avg_idle with sd->max_cost, the existing avg_idle would 
> not be accurate since it is limited based on migration_cost, so I increased the 
> max avg_idle to 25*sched_migration_cost.

One thing we can do is make that independent of sched_migration_cost and
stretch it dynamically to be 2*max_idle_balance_cost or somesuch. That
would avoid the magic number and make it work for machines that are much
'slower' than yours as well.

> Additionally, I updated avg_idle by 
> calling update_avg() first. Then if the avg_idle exceeds the max, the avg_idle 
> is set to the max. This is to prevent avg_idle from being set to the maximum 
> after 1 long idle.

Fully agreed, this is something we should do regardless -- for as long
as we preserve the avg_idle() machinery anyway :-)

> Since I have found idle balance to be beneficial when it is not failing to move 
> tasks, I was thinking we can also not skip newidle balance (regardless of what 
> avg_idle and max_cost are) if the previous attempt on the rq or domain 
> succeeded in moving tasks. I was also wondering if we should periodically reset
> the max cost. Both would require an extra field to be added to either the
> rq or domain structure though.

I think both ideas are good things to try; but I would like them to be
follow-up patches. I'm not worried too much about growing either
structures.

The thing you 'forgot' to mention is if this patch actually helps you
workload?

  reply	other threads:[~2013-08-22 11:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-20  9:32 Jason Low
2013-08-22 11:10 ` Peter Zijlstra [this message]
2013-08-22 19:42   ` Jason Low

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=20130822111027.GJ31370@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=jason.low2@hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.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

Powered by JetHome