public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rik van Riel <riel@redhat.com>
To: Jason Low <jason.low2@hp.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	KML <linux-kernel@vger.kernel.org>,
	Mike Galbraith <efault@gmx.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Paul Turner <pjt@google.com>, Alex Shi <alex.shi@intel.com>,
	Preeti U Murthy <preeti@linux.vnet.ibm.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Morten Rasmussen <morten.rasmussen@arm.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Kees Cook <keescook@chromium.org>, Mel Gorman <mgorman@suse.de>,
	aswin@hp.com, scott.norton@hp.com, chegu_vinod@hp.com,
	Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Subject: Re: [RFC PATCH] sched: Reduce overestimating avg_idle
Date: Wed, 31 Jul 2013 12:00:26 -0400	[thread overview]
Message-ID: <51F9349A.3090605@redhat.com> (raw)
In-Reply-To: <1375263472.3922.26.camel@j-VirtualBox>

On 07/31/2013 05:37 AM, Jason Low wrote:

> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index e8b3350..62b484b 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -1341,12 +1341,12 @@ ttwu_do_wakeup(struct rq *rq, struct task_struct *p, int wake_flags)
>
>   	if (rq->idle_stamp) {
>   		u64 delta = rq->clock - rq->idle_stamp;
> -		u64 max = 2*sysctl_sched_migration_cost;
> +		u64 max = (sysctl_sched_migration_cost * 3) / 2;
>
> -		if (delta > max)
> +		update_avg(&rq->avg_idle, delta);
> +
> +		if (rq->avg_idle > max)
>   			rq->avg_idle = max;
> -		else
> -			update_avg(&rq->avg_idle, delta);
>   		rq->idle_stamp = 0;
>   	}

I wonder if we could get even more conservative values
of avg_idle by clamping delta to max, before calling
update_avg...

Or rather, I wonder if that would matter enough to make
a difference, and in what direction that difference would
be.

In other words:

	if (rq->idle_stamp) {
		u64 delta = rq->clock - rq->idle_stamp;
		u64 max = (sysctl_sched_migration_cost * 3) / 2;

		if (delta > max)
			delta = max;

		update_avg(&rq->avg_idle, delta);
		rq->idle_stamp = 0;
	}

-- 
All rights reversed

  parent reply	other threads:[~2013-07-31 16:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-31  9:37 [RFC PATCH] sched: Reduce overestimating avg_idle Jason Low
2013-07-31  9:53 ` Peter Zijlstra
2013-08-02  8:20   ` Jason Low
2013-07-31 15:45 ` Rik van Riel
2013-07-31 16:00 ` Rik van Riel [this message]
2013-08-01  7:36   ` Jason Low
2013-08-01  7:48     ` Peter Zijlstra

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=51F9349A.3090605@redhat.com \
    --to=riel@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=alex.shi@intel.com \
    --cc=aswin@hp.com \
    --cc=chegu_vinod@hp.com \
    --cc=efault@gmx.de \
    --cc=jason.low2@hp.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=morten.rasmussen@arm.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=preeti@linux.vnet.ibm.com \
    --cc=scott.norton@hp.com \
    --cc=srikar@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=vincent.guittot@linaro.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