public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Morten Rasmussen <morten.rasmussen@arm.com>
To: Michael wang <wangyun@linux.vnet.ibm.com>
Cc: "mingo@kernel.org" <mingo@kernel.org>,
	"peterz@infradead.org" <peterz@infradead.org>,
	"pjt@google.com" <pjt@google.com>,
	"arjan@linux.intel.com" <arjan@linux.intel.com>,
	"rjw@sisk.pl" <rjw@sisk.pl>,
	"dirk.j.brandewie@intel.com" <dirk.j.brandewie@intel.com>,
	"vincent.guittot@linaro.org" <vincent.guittot@linaro.org>,
	"alex.shi@linaro.org" <alex.shi@linaro.org>,
	"preeti@linux.vnet.ibm.com" <preeti@linux.vnet.ibm.com>,
	"efault@gmx.de" <efault@gmx.de>,
	"corbet@lwn.net" <corbet@lwn.net>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	Catalin Marinas <Catalin.Marinas@arm.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linaro-kernel@lists.linaro.org" <linaro-kernel@lists.linaro.org>
Subject: Re: [RFC][PATCH 3/7] sched: power: go_faster/slower power driver hints
Date: Mon, 14 Oct 2013 13:42:43 +0100	[thread overview]
Message-ID: <20131014124243.GL31039@e103034-lin> (raw)
In-Reply-To: <5258BABF.4020404@linux.vnet.ibm.com>

Hi Michael,

On Sat, Oct 12, 2013 at 03:58:07AM +0100, Michael wang wrote:
> Hi, Morten
> 
> On 10/12/2013 01:19 AM, Morten Rasmussen wrote:
> [snip]
> >  
> > @@ -5743,6 +5772,7 @@ static void run_rebalance_domains(struct softirq_action *h)
> >  	 */
> >  	nohz_idle_balance(this_cpu, idle);
> >  
> > +	inc_cpu_capacity(this_cpu);
> 
> Just wondering is this check necessary here? if rq get more tasks during
> the balance, enqueue_task() should already do the check each time when
> we move_task(), isn't it?

True. enqueue_task() should do the necessary check when we move tasks.
Hovewer, the cpu load may change over time without moving tasks if a
task changes its behavior. A small task may enter a cpu intensive phase
and grow bigger over time while staying on the rq due to the load
tracking. That won't be noticed unless we check the cpuload
periodically. That is the reason behind this check.

I will look at remove the redundant call to inc_cpu_capacity() when
actually did move tasks. More work is needed on the policy for
inc/dec_cpu_capacity(). I just added a few easy examples of how they can
be used for this post.

Thanks,
Morten

> 
> Regards,
> Michael Wang
> 
> >  	power_late_callback(this_cpu);
> >  }
> >  
> > diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
> > index 907a967..88e7968 100644
> > --- a/kernel/sched/sched.h
> > +++ b/kernel/sched/sched.h
> > @@ -1367,8 +1367,26 @@ static inline u64 irq_time_read(int cpu)
> >  
> >  #ifdef CONFIG_SCHED_POWER
> >  extern void power_late_callback(int cpu);
> > +extern int at_max_capacity(int cpu);
> > +extern int go_faster(int cpu, int hint);
> > +extern int go_slower(int cpu, int hint);
> >  #else
> >  static inline void power_late_callback(int cpu)
> >  {
> >  }
> > +
> > +static inline int at_max_capacity(int cpu)
> > +{
> > +	return 1;
> > +}
> > +
> > +static inline int go_faster(int cpu, int hint)
> > +{
> > +	return 0;
> > +}
> > +
> > +static inline int go_slower(int cpu, int hint)
> > +{
> > +	return 0;
> > +}
> >  #endif /* CONFIG_SCHED_POWER */
> > 
> 
> 


  reply	other threads:[~2013-10-14 12:42 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-11 17:19 [RFC][PATCH 0/7] Power-aware scheduling v2 Morten Rasmussen
2013-10-11 17:19 ` [RFC][PATCH 1/7] Initial power driver interface infrastructure Morten Rasmussen
2013-10-11 17:19 ` [RFC][PATCH 2/7] sched: power: Power driver late callback interface Morten Rasmussen
2013-10-14 13:42   ` Peter Zijlstra
2013-10-11 17:19 ` [RFC][PATCH 3/7] sched: power: go_faster/slower power driver hints Morten Rasmussen
2013-10-12  2:58   ` Michael wang
2013-10-14 12:42     ` Morten Rasmussen [this message]
2013-10-14 13:48   ` Peter Zijlstra
2013-10-14 15:55     ` Morten Rasmussen
2013-10-11 17:19 ` [RFC][PATCH 4/7] sched: power: Remove power capacity hints for kworker threads Morten Rasmussen
2013-10-14 13:33   ` Peter Zijlstra
2013-10-14 15:14     ` Arjan van de Ven
2013-10-17 16:40       ` Morten Rasmussen
2013-10-17 16:54         ` Peter Zijlstra
2013-10-17 17:18           ` Arjan van de Ven
2013-10-18  8:47             ` Morten Rasmussen
2013-10-18 13:43               ` Arjan van de Ven
2013-10-18  8:38           ` Morten Rasmussen
2013-10-14 16:10     ` Morten Rasmussen
2013-10-14 16:13       ` Arjan van de Ven
2013-10-14 17:19         ` Morten Rasmussen
2013-10-11 17:19 ` [RFC][PATCH 5/7] sched: power: Increase cpu capacity based on rq tracked load Morten Rasmussen
2013-10-11 17:19 ` [RFC][PATCH 6/7] sched: power: cpufreq: Initial schedpower cpufreq governor/power driver Morten Rasmussen
2013-10-11 17:19 ` [RFC][PATCH 7/7] sched: power: Let the power driver choose the best wake-up cpu Morten Rasmussen
2013-10-14 13:32 ` [RFC][PATCH 0/7] Power-aware scheduling v2 Peter Zijlstra
2013-10-14 17:15   ` Morten Rasmussen
2013-10-14 17:31     ` Peter Zijlstra
2013-10-15 17:05       ` Morten Rasmussen
2013-10-15  9:57   ` Preeti U Murthy

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=20131014124243.GL31039@e103034-lin \
    --to=morten.rasmussen@arm.com \
    --cc=Catalin.Marinas@arm.com \
    --cc=alex.shi@linaro.org \
    --cc=arjan@linux.intel.com \
    --cc=corbet@lwn.net \
    --cc=dirk.j.brandewie@intel.com \
    --cc=efault@gmx.de \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=preeti@linux.vnet.ibm.com \
    --cc=rjw@sisk.pl \
    --cc=tglx@linutronix.de \
    --cc=vincent.guittot@linaro.org \
    --cc=wangyun@linux.vnet.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