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]
Date:	Fri, 11 Oct 2013 18:19:15 +0100
From:	Morten Rasmussen <morten.rasmussen@....com>
To:	mingo@...nel.org, peterz@...radead.org
Cc:	pjt@...gle.com, arjan@...ux.intel.com, rjw@...k.pl,
	dirk.j.brandewie@...el.com, vincent.guittot@...aro.org,
	alex.shi@...aro.org, preeti@...ux.vnet.ibm.com, efault@....de,
	corbet@....net, tglx@...utronix.de, catalin.marinas@....com,
	morten.rasmussen@....com, linux-kernel@...r.kernel.org,
	linaro-kernel@...ts.linaro.org
Subject: [RFC][PATCH 5/7] sched: power: Increase cpu capacity based on rq tracked load

weighted_cpuload() gives the sum of priority scaled task loads. One
NICE 0 task is not be enough load to trigger a cpu capacity increase
when cpu_power > 1024. The rq->avg.runnable_avg_sum tracks the actual
busy time of the cpu and is therefore a more accurate indication of
the cpu load. If the rq tracked load is high the cpu is busy even if
the weighted_cpuload() should indicate otherwise.

Signed-off-by: Morten Rasmussen <morten.rasmussen@....com>
---
 kernel/sched/fair.c |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index ea8d973..ee87e65 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -2861,7 +2861,17 @@ static inline void inc_cpu_capacity(int cpu, struct task_struct *p)
 	if (p && p->flags & PF_WQ_WORKER)
 		return;
 
-	if (weighted_cpuload(cpu) > power_of(cpu))
+	if (weighted_cpuload(cpu) > power_of(cpu)) {
+		go_faster(cpu, 0);
+		return;
+	}
+
+	/*
+	 * Go faster if the cpu is 80% busy. This threshold should
+	 * be set by the power driver later.
+	 */
+	if (cpu_rq(cpu)->avg.runnable_avg_sum * 100 >
+		80 * cpu_rq(cpu)->avg.runnable_avg_period)
 		go_faster(cpu, 0);
 }
 
-- 
1.7.9.5


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