All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacob Pan <jacob.jun.pan@linux.intel.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: "Pan, Jacob jun" <jacob.jun.pan@intel.com>,
	Preeti U Murthy <preeti@linux.vnet.ibm.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Viresh Kumar <viresh.kumar@linaro.org>, LKP <lkp@01.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"Zhang, Rui" <rui.zhang@intel.com>,
	Frederic Weisbecker <frederic@kernel.org>,
	Eduardo Valentin <edubezval@gmail.com>,
	"Van De Ven, Arjan" <arjan.van.de.ven@intel.com>
Subject: Re: [PATCH] tick/powerclamp: Remove tick_nohz_idle abuse
Date: Fri, 19 Dec 2014 10:39:00 -0800	[thread overview]
Message-ID: <20141219103900.101f6c6d@jacob-VirtualBox> (raw)
In-Reply-To: <alpine.DEB.2.11.1412182209010.17382@nanos>

On Thu, 18 Dec 2014 22:12:57 +0100 (CET)
Thomas Gleixner <tglx@linutronix.de> wrote:

> On Thu, 18 Dec 2014, Jacob Pan wrote:
> > OK I agree, also as I mentioned earlier, Peter already has a patch
> > for consolidated idle loop and remove tick_nohz_idle_enter/exit
> > call from powerclamp driver. I have been working on a few tweaks to
> > maintain the functionality and efficiency with the consolidated
> > idle loop. We can apply the patches on top of yours.
> 
> No. This is equally wrong as I pointed out before. The 'unified' idle
> loop is still fake and just pretending to be idle.
> 
In terms of efficiency, the consolidated idle loop will allow turning
off sched tick during idle injection period. If we just take out the
tick_nohz_idle_xxx call, the effectiveness of powerclamp is going down
significantly. I am not arguing the design but from fixing regression
perspective or short term solution.
> If simple standard interfaces like cpu_idle() are not working from
> idle code anymore then this simply stinks. And that's what any fake
> idle thread will do.
> 
> The whole approach is wrong. Implement a sched fair throttler and you
> can avoid the whoile trainwreck.
>
I agree with you that fake idle always have dilemma. on one
side, idle injection threads are really busy injecting idle, so from
that standpoint it is not idle. But on the other side, we have to stop
tick to avoid being woken up all the time. So we can't just simply take
control of the cpu periodically and execute mwait.
I need to do some study here, thanks for the pointers,

Jacob

> > > 1. Queue a deferable periodic timer whose handler checks if idle
> > > needs to be injected. If so, it sets rq->need_throttle for the
> > > cpu. If its already in the fake idle period, it clears
> > > rq->need_throttle and sets need_resched.
> > > 
> > The key to powerclamp driver is to achieve package level idle
> > states, which implies synchronized idle injection. From
> > power/performance standpoint, only package level idle states is
> > worth injection.
> 
> Then use a synchronized non deferrable timer on all cpus. It's simple
> enough.
>  
> Thanks,
> 
> 	tglx

[Jacob Pan]

WARNING: multiple messages have this Message-ID (diff)
From: Jacob Pan <jacob.jun.pan@linux.intel.com>
To: lkp@lists.01.org
Subject: Re: [PATCH] tick/powerclamp: Remove tick_nohz_idle abuse
Date: Fri, 19 Dec 2014 10:39:00 -0800	[thread overview]
Message-ID: <20141219103900.101f6c6d@jacob-VirtualBox> (raw)
In-Reply-To: <alpine.DEB.2.11.1412182209010.17382@nanos>

[-- Attachment #1: Type: text/plain, Size: 2214 bytes --]

On Thu, 18 Dec 2014 22:12:57 +0100 (CET)
Thomas Gleixner <tglx@linutronix.de> wrote:

> On Thu, 18 Dec 2014, Jacob Pan wrote:
> > OK I agree, also as I mentioned earlier, Peter already has a patch
> > for consolidated idle loop and remove tick_nohz_idle_enter/exit
> > call from powerclamp driver. I have been working on a few tweaks to
> > maintain the functionality and efficiency with the consolidated
> > idle loop. We can apply the patches on top of yours.
> 
> No. This is equally wrong as I pointed out before. The 'unified' idle
> loop is still fake and just pretending to be idle.
> 
In terms of efficiency, the consolidated idle loop will allow turning
off sched tick during idle injection period. If we just take out the
tick_nohz_idle_xxx call, the effectiveness of powerclamp is going down
significantly. I am not arguing the design but from fixing regression
perspective or short term solution.
> If simple standard interfaces like cpu_idle() are not working from
> idle code anymore then this simply stinks. And that's what any fake
> idle thread will do.
> 
> The whole approach is wrong. Implement a sched fair throttler and you
> can avoid the whoile trainwreck.
>
I agree with you that fake idle always have dilemma. on one
side, idle injection threads are really busy injecting idle, so from
that standpoint it is not idle. But on the other side, we have to stop
tick to avoid being woken up all the time. So we can't just simply take
control of the cpu periodically and execute mwait.
I need to do some study here, thanks for the pointers,

Jacob

> > > 1. Queue a deferable periodic timer whose handler checks if idle
> > > needs to be injected. If so, it sets rq->need_throttle for the
> > > cpu. If its already in the fake idle period, it clears
> > > rq->need_throttle and sets need_resched.
> > > 
> > The key to powerclamp driver is to achieve package level idle
> > states, which implies synchronized idle injection. From
> > power/performance standpoint, only package level idle states is
> > worth injection.
> 
> Then use a synchronized non deferrable timer on all cpus. It's simple
> enough.
>  
> Thanks,
> 
> 	tglx

[Jacob Pan]

  reply	other threads:[~2014-12-19 18:49 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-18 10:51 [PATCH] tick/powerclamp: Remove tick_nohz_idle abuse Thomas Gleixner
2014-12-18 10:51 ` Thomas Gleixner
2014-12-18 14:01 ` Eduardo Valentin
2014-12-18 14:01   ` Eduardo Valentin
2014-12-18 14:43   ` Thomas Gleixner
2014-12-18 14:43     ` Thomas Gleixner
2014-12-18 17:28 ` Preeti U Murthy
2014-12-18 17:28   ` Preeti U Murthy
     [not found]   ` <DD415AA12F8FF042BF4EA69DF123C1478AF91730@ORSMSX101.amr.corp.intel.com>
2014-12-18 19:52     ` Jacob Pan
2014-12-18 19:52       ` Jacob Pan
2014-12-18 21:12       ` Thomas Gleixner
2014-12-18 21:12         ` Thomas Gleixner
2014-12-19 18:39         ` Jacob Pan [this message]
2014-12-19 18:39           ` Jacob Pan
2014-12-19 19:56           ` Thomas Gleixner
2014-12-19 19:56             ` Thomas Gleixner
2014-12-20  1:31             ` Preeti U Murthy
2014-12-20  1:31               ` Preeti U Murthy
2014-12-23  2:57               ` Jacob Pan
2014-12-23  2:57                 ` Jacob Pan
2014-12-31  5:04                 ` Preeti U Murthy
2014-12-31  5:04                   ` Preeti U Murthy
2014-12-19 13:09 ` [tip:timers/urgent] " tip-bot for Thomas Gleixner
2014-12-19 13:09   ` tip-bot for Thomas Gleixner

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=20141219103900.101f6c6d@jacob-VirtualBox \
    --to=jacob.jun.pan@linux.intel.com \
    --cc=arjan.van.de.ven@intel.com \
    --cc=edubezval@gmail.com \
    --cc=frederic@kernel.org \
    --cc=jacob.jun.pan@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@01.org \
    --cc=peterz@infradead.org \
    --cc=preeti@linux.vnet.ibm.com \
    --cc=rui.zhang@intel.com \
    --cc=tglx@linutronix.de \
    --cc=viresh.kumar@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 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.