lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1316030695-19826-6-git-send-email-glommer@parallels.com>
Date:	Wed, 14 Sep 2011 17:04:51 -0300
From:	Glauber Costa <glommer@...allels.com>
To:	linux-kernel@...r.kernel.org
Cc:	xemul@...allels.com, paul@...lmenage.org, lizf@...fujitsu.com,
	daniel.lezcano@...e.fr, mingo@...e.hu, a.p.zijlstra@...llo.nl,
	jbottomley@...allels.com, Glauber Costa <glommer@...allels.com>
Subject: [PATCH 5/9] Include guest fields in cpuacct

Signed-off-by: Glauber Costa <glommer@...allels.com>
---
 kernel/sched.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index a36d995..f0309a0 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -1450,6 +1450,8 @@ enum cpuacct_stat_index {
 	CPUACCT_STAT_SYSTEM,	/* ... kernel mode */
 	CPUACCT_STAT_IRQ,	/* ... irq ticks */
 	CPUACCT_STAT_SOFTIRQ,	/* ... softirq ticks */
+	CPUACCT_STAT_GUEST,	/* ... guest mode */
+	CPUACCT_STAT_GUEST_NICE,	/* ... guest nice */
 
 	CPUACCT_STAT_NSTATS,
 };
@@ -3793,6 +3795,8 @@ static void account_guest_time(struct task_struct *p, cputime_t cputime,
 {
 	cputime64_t tmp;
 	struct cpu_usage_stat *cpustat = &kstat_this_cpu.cpustat;
+	int stat = CPUACCT_STAT_NICE;
+	int statnice = CPUACCT_STAT_GUEST_NICE;
 
 	tmp = cputime_to_cputime64(cputime);
 
@@ -3809,7 +3813,12 @@ static void account_guest_time(struct task_struct *p, cputime_t cputime,
 	} else {
 		cpustat->user = cputime64_add(cpustat->user, tmp);
 		cpustat->guest = cputime64_add(cpustat->guest, tmp);
+		stat = CPUACCT_STAT_USER;
+		statnice = CPUACCT_STAT_GUEST;
 	}
+
+	cpuacct_update_stats(p, stat, tmp);
+	cpuacct_update_stats(p, statnice, tmp);
 }
 
 /*
-- 
1.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ