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: <1413958051-7103-4-git-send-email-mturquette@linaro.org>
Date:	Tue, 21 Oct 2014 23:07:27 -0700
From:	Mike Turquette <mturquette@...aro.org>
To:	peterz@...radead.org, mingo@...nel.org
Cc:	linux-kernel@...r.kernel.org, preeti@...ux.vnet.ibm.com,
	Morten.Rasmussen@....com, kamalesh@...ux.vnet.ibm.com,
	riel@...hat.com, efault@....de, nicolas.pitre@...aro.org,
	linaro-kernel@...ts.linaro.org, daniel.lezcano@...aro.org,
	dietmar.eggemann@....com, pjt@...gle.com, bsegall@...gle.com,
	vincent.guittot@...aro.org, patches@...aro.org,
	tuukka.tikkanen@...aro.org, amit.kucheria@...aro.org,
	Mike Turquette <mturquette@...aro.org>
Subject: [PATCH RFC 3/7] sched: fair: add usage_util_of helper

Signed-off-by: Mike Turquette <mturquette@...aro.org>
---
 kernel/sched/fair.c  | 6 ++++++
 kernel/sched/sched.h | 1 +
 2 files changed, 7 insertions(+)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 15f5638..0930ad8 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -2057,6 +2057,7 @@ static inline void account_numa_dequeue(struct rq *rq, struct task_struct *p)
 
 #ifdef CONFIG_SMP
 unsigned long capacity_of(int cpu);
+unsigned long usage_util_of(int cpu);
 #endif /* CONFIG_SMP */
 
 static void
@@ -4140,6 +4141,11 @@ unsigned long capacity_of(int cpu)
 	return cpu_rq(cpu)->cpu_capacity;
 }
 
+unsigned long usage_util_of(int cpu)
+{
+	return cpu_rq(cpu)->cfs.usage_util_avg;
+}
+
 static unsigned long cpu_avg_load_per_task(int cpu)
 {
 	struct rq *rq = cpu_rq(cpu);
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 9a28d38..c34cbfc 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -310,6 +310,7 @@ struct cfs_bandwidth { };
 #endif	/* CONFIG_CGROUP_SCHED */
 
 extern unsigned long capacity_of(int cpu);
+extern unsigned long usage_util_of(int cpu);
 
 /* CFS-related fields in a runqueue */
 struct cfs_rq {
-- 
1.8.3.2

--
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