From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Ruchi Kandoi <kandoiruchi@google.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Viresh Kumar <viresh.kumar@linaro.org>,
Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>,
Oleg Nesterov <oleg@redhat.com>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
Vladimir Davydov <vdavydov@parallels.com>,
Heinrich Schuchardt <xypron.glpk@gmx.de>,
Thomas Gleixner <tglx@linutronix.de>,
Kees Cook <keescook@chromium.org>,
Konstantin Khlebnikov <khlebnikov@yandex-team.ru>,
Davidlohr Bueso <dave@stgolabs.net>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 0/2] Adds cpu power accounting per-pid basis.
Date: Thu, 21 May 2015 16:34:43 +0200 [thread overview]
Message-ID: <555DED03.9070002@linaro.org> (raw)
In-Reply-To: <1431648770-7404-1-git-send-email-kandoiruchi@google.com>
Hi Ruchi,
On 05/15/2015 02:12 AM, Ruchi Kandoi wrote:
> These patches add a mechanism which will accurately caculate the CPU power
> used by all the processes in the system. In order to account for the power
> used by all the processes a data field "cpu_power" has been added in the
> task_struct.
The term 'energy' makes more sense than 'power'.
> This field adds power for both the system as well as user
> time. cpu_power contains the total amount of charge(in uAmsec units) used
Why not use the Joules unit ?
> by the process. This model takes into account the frequency at which the
> process was running(i.e higher power for processes running at higher
> frequencies). It requires the cpufreq_stats module to be initialized with
> the current numbers for each of the CPU core at each frequency. This will
> be initialized during init time.
The energy task accounting is an interesting feature in my opinion. But
your patchset does not deal with the power management hardware complexity.
If we reduce the scope of the task energy accounting to the cpu, we are
facing several issues:
* A cpu may be supposed to run at a specific OPP but it could share a
clock line with another cpu which is in a higher frequency. So the
frequency is actually at a higher rate than what is assumed
* The firmware may override the cpufreq decisions
* A process may be idle but its behavior forces the cpuidle governor
to choose shallow states (that won't occur without the process). For
example, the process is using very short timers, does a small processing
and then go to sleep again waiting for the next timer expiration. The
result will be a process having a low energy consumption but actually
because of these timers, it will prevent the cpu to enter deep idle state
Beside that, the process may be soliciting a subsystem (another process
or hardware) which consumes a lot of energy. That won't be accounted
even if the process is responsible of this extra consumption.
And the last point is: how do you expect to have the energy numbers as
nobody is willing to share them for their platform ?
> Ruchi Kandoi (2):
> cpufreq_stats: Adds sysfs file
> /sys/devices/system/cpu/cpufreq/current_in_state
> sched: cpufreq: Adds a field cpu_power in the task_struct
>
> drivers/cpufreq/cpufreq_stats.c | 191 +++++++++++++++++++++++++++++++++++++++-
> include/linux/cpufreq.h | 8 ++
> include/linux/sched.h | 2 +
> kernel/fork.c | 1 +
> kernel/sched/cputime.c | 7 ++
> 5 files changed, 207 insertions(+), 2 deletions(-)
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
next prev parent reply other threads:[~2015-05-21 14:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-15 0:12 [PATCH v2 0/2] Adds cpu power accounting per-pid basis Ruchi Kandoi
2015-05-15 0:12 ` [PATCH v2 1/2] cpufreq_stats: Adds sysfs file /sys/devices/system/cpu/cpufreq/current_in_state Ruchi Kandoi
2015-05-15 2:48 ` Viresh Kumar
2015-05-16 0:55 ` Ruchi Kandoi
2015-05-16 2:15 ` Viresh Kumar
2015-05-15 0:12 ` [PATCH v2 2/2] sched: cpufreq: Adds a field cpu_power in the task_struct Ruchi Kandoi
2015-05-15 6:34 ` [PATCH v2 0/2] Adds cpu power accounting per-pid basis Heinrich Schuchardt
2015-05-18 21:00 ` Ruchi Kandoi
2015-05-21 14:34 ` Daniel Lezcano [this message]
2015-05-28 19:37 ` Ruchi Kandoi
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=555DED03.9070002@linaro.org \
--to=daniel.lezcano@linaro.org \
--cc=akpm@linux-foundation.org \
--cc=dave@stgolabs.net \
--cc=kandoiruchi@google.com \
--cc=keescook@chromium.org \
--cc=khlebnikov@yandex-team.ru \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=rjw@rjwysocki.net \
--cc=tglx@linutronix.de \
--cc=vdavydov@parallels.com \
--cc=viresh.kumar@linaro.org \
--cc=xypron.glpk@gmx.de \
/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;
as well as URLs for NNTP newsgroup(s).