All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Amit Kucheria <amit.kucheria@linaro.org>,
	Ingo Molnar <mingo@elte.hu>,
	Lists linaro-kernel <linaro-kernel@lists.linaro.org>,
	Linux PM list <linux-pm@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/3] sched: idle: Add sched balance option
Date: Mon, 05 May 2014 02:32:31 +0200	[thread overview]
Message-ID: <11389655.8tCmxgKokW@vostro.rjw.lan> (raw)
In-Reply-To: <535F7E23.7020104@linaro.org>

On Tuesday, April 29, 2014 12:25:39 PM Daniel Lezcano wrote:
> On 04/29/2014 01:11 AM, Rafael J. Wysocki wrote:
> > On Monday, April 28, 2014 01:07:31 PM Daniel Lezcano wrote:

[cut]

> > In my opinion it would be much better to have a knob representing the current
> > relative value of energy to the user (which may depend on things like whether
> > or not the system is on battery etc) and meaning how far we need to go with
> > energy saving efforts.
> >
> > So if that knob is 0, we'll do things that are known-good for performance.
> > If it is 1, we'll do some extra effort to save enery as well possibly at
> > a small expense of performance if that's necessary.  If it is 100, we'll do
> > all we can to save as much energy as possible without caring about performance
> > at all.
> >
> > And it doesn't even have to be scheduler-specific, it very well may be global.
> 
> That would be very nice but I don't see how we can quantify this energy 
> and handle that generically from the kernel for all the hardware.
> 
> I am pretty sure we will discover for some kind of hardware a specific 
> option will consume more power, argh ! energy I mean, than another 
> hardware because of the architecture.
> 
>  From my personal experience, when we are facing this kind of complexity 
> and heuristic, it is the sign the userspace has some work to do.
> 
> What I am proposing is not in contradiction with your approach, it is 
> about exporting a lot of knobs to userspace, and the userspace decide 
> how to map what is '0' <--> '100' regarding these options. Nothing 
> prevent the different platform to set a default value for these options.

Our experience so far, however, is that user space is not really likely to
change the default values of such knobs.

>  From my POV, the cgroup could be a good solution for that for different 
> reasons. Especially one good reason is we can stick the energy policy 
> per task instead of the entire system.
> 
> Let's imagine the following scenario:
> 
> An user has a laptop running a mailer looking for the email every 5 
> minutes. The system switched to 'power'. The user wants to play a video 
> game but due to the 'power' policy, the game is not playable so it 
> forces the policy to 'performance'. All the tasks will use the 
> 'performance' policy, thus consuming more energy.

This isn't all about the given task, but also about devices that are in use
while it is being run.  For example, to play a game the user would probably
like the input subsystem to be more responsive and the screen to be brighter
etc.  If that is a network game, the network adapter will probably need to
work in the "performance" mode too.

> If we do per task, the video game will use the 'performance' policy and 
> the other tasks on the system will use the 'power' policy. The userspace 
> can take the decision to freeze the application running 'performance' if 
> we reach a critical battery level.

Well, consider task packing in that context and suppose that according to the
current policy task packing should be applied to "energy efficient" tasks, but
not to "performance" tasks.  Now, suppose that there's an "energy efficient"
task to run and there's a core occupied by a "performace" task.  Should the
"energy efficient" task be run on that core or should we find another one
for it?  Who's more important in that case?

> The cgroup is a good framework to do that and gives a lot of flexibility 
> to userspace. I understood Peter does not like the cgroup but I did not 
> give up to convince him, the cgroup could be good solution :)

Will user space actually use that flexibility?

> Looking forward, if the energy policy is tied with the task, in the 
> future we can normalize the energy consumption and stick to an 'energy 
> load' per task and reuse the load tracking for energy, do per task 
> energy accounting, nice per energy, etc ...

That can be done, but some parts of the kernel that may benefit from an
"energy conservation bias" knob are not tied to any particular task.  The
block layer may be one example here.

> Going back to reality, concretely this sysctl patch did not reach a 
> consensus. So I will resend the two other patches, hoping the discussion 
> will lead to an agreement.

Well, the discussion so far has been useful to me anyway. :-)

Thanks!


-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

  reply	other threads:[~2014-05-05  0:15 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-24 12:24 [PATCH 0/3] sched: idle: Provide the basis to integrate cpuidle Daniel Lezcano
2014-04-24 12:24 ` [PATCH 1/3] sched: idle: Encapsulate the code to compile it out Daniel Lezcano
2014-04-30 17:39   ` Nicolas Pitre
2014-04-24 12:24 ` [PATCH 2/3] sched: idle: Add sched balance option Daniel Lezcano
     [not found]   ` <CAP245DX9wewQFhcyGj5ZuNE7hHC4fRn90POC32HLF6ugja6nJg@mail.gmail.com>
2014-04-24 13:30     ` Daniel Lezcano
2014-04-25 10:54       ` Amit Kucheria
2014-04-25 11:46         ` Rafael J. Wysocki
2014-04-25 12:17           ` Daniel Lezcano
2014-04-25 13:20           ` Peter Zijlstra
2014-04-25 17:01             ` Daniel Lezcano
2014-04-25 18:43               ` Peter Zijlstra
2014-04-28 10:09                 ` Daniel Lezcano
2014-04-28 10:28                   ` Peter Zijlstra
2014-04-28 11:07                     ` Daniel Lezcano
2014-04-28 11:21                       ` Peter Zijlstra
2014-04-28 23:11                       ` Rafael J. Wysocki
2014-04-29 10:00                         ` Morten Rasmussen
2014-04-29 22:19                           ` Rafael J. Wysocki
2014-04-29 10:25                         ` Daniel Lezcano
2014-05-05  0:32                           ` Rafael J. Wysocki [this message]
2014-04-29  9:26                       ` Morten Rasmussen
2014-04-26  0:18             ` Rafael J. Wysocki
2014-04-26  6:17               ` Ingo Molnar
2014-04-27 13:23                 ` Rafael J. Wysocki
2014-04-29 10:50                   ` Morten Rasmussen
2014-04-29 22:02                     ` Rafael J. Wysocki
2014-04-26 10:55               ` Peter Zijlstra
2014-04-27 13:54                 ` Rafael J. Wysocki
2014-04-27 19:39                   ` Peter Zijlstra
2014-04-25 13:22         ` Peter Zijlstra
2014-04-24 12:24 ` [PATCH 3/3] sched: idle: Store the idle state the cpu is Daniel Lezcano
2014-04-24 16:16   ` Rafael J. Wysocki
2014-04-24 16:13 ` [PATCH 0/3] sched: idle: Provide the basis to integrate cpuidle Rafael J. Wysocki

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=11389655.8tCmxgKokW@vostro.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=amit.kucheria@linaro.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.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.