lkml.org 
[lkml]   [2013]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v7 07/11] sched: account guest time per-cgroup as well.
On Wed, May 29, 2013 at 03:03:18PM +0400, Glauber Costa wrote:
> We already track multiple tick statistics per-cgroup, using
> the task_group_account_field facility. This patch accounts
> guest_time in that manner as well.
>
> Signed-off-by: Glauber Costa <glommer@openvz.org>
> CC: Peter Zijlstra <a.p.zijlstra@chello.nl>
> CC: Paul Turner <pjt@google.com>
> ---
> kernel/sched/cputime.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c
> index 74a44ef..e653e52 100644
> --- a/kernel/sched/cputime.c
> +++ b/kernel/sched/cputime.c
> @@ -183,8 +183,6 @@ void account_user_time(struct task_struct *p, cputime_t cputime,
> static void account_guest_time(struct task_struct *p, cputime_t cputime,
> cputime_t cputime_scaled)
> {
> - u64 *cpustat = kcpustat_this_cpu->cpustat;
> -
> /* Add guest time to process. */
> p->utime += cputime;
> p->utimescaled += cputime_scaled;
> @@ -193,11 +191,11 @@ static void account_guest_time(struct task_struct *p, cputime_t cputime,
>
> /* Add guest time to cpustat. */
> if (TASK_NICE(p) > 0) {
> - cpustat[CPUTIME_NICE] += (__force u64) cputime;
> - cpustat[CPUTIME_GUEST_NICE] += (__force u64) cputime;
> + task_group_account_field(p, CPUTIME_NICE, (__force u64) cputime);
> + task_group_account_field(p, CPUTIME_GUEST, (__force u64) cputime);
> } else {
> - cpustat[CPUTIME_USER] += (__force u64) cputime;
> - cpustat[CPUTIME_GUEST] += (__force u64) cputime;
> + task_group_account_field(p, CPUTIME_USER, (__force u64) cputime);
> + task_group_account_field(p, CPUTIME_GUEST, (__force u64) cputime);

This is a behavior change, right? It seems sane to me but maybe the
patch description should be more explicit?

Thanks.

--
tejun


\
 
 \ /
  Last update: 2013-06-07 02:21    [W:0.110 / U:6.468 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site