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:14 +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 4/7] sched: power: Remove power capacity hints for kworker threads

Removing power hints for kworker threads enables easier use of
workqueues in the power driver late callback. That would otherwise
lead to an endless loop unless it is prevented in the power driver.

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

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 50ae0ce..ea8d973 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -2856,23 +2856,29 @@ static inline void hrtick_update(struct rq *rq)
 static unsigned long weighted_cpuload(const int cpu);
 static unsigned long power_of(int cpu);
 
-static inline void inc_cpu_capacity(int cpu)
+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))
 		go_faster(cpu, 0);
 }
 
-static inline void dec_cpu_capacity(int cpu)
+static inline void dec_cpu_capacity(int cpu, struct task_struct *p)
 {
+	if (p && p->flags & PF_WQ_WORKER)
+		return;
+
 	if (weighted_cpuload(cpu) < power_of(cpu))
 		go_slower(cpu, 0);
 }
 #else
-static inline void inc_cpu_capacity(int cpu)
+static inline void inc_cpu_capacity(int cpu, struct task_struct *p)
 {
 }
 
-static inline void dec_cpu_capacity(int cpu)
+static inline void dec_cpu_capacity(int cpu, struct task_struct *p)
 {
 }
 #endif
@@ -2923,7 +2929,7 @@ enqueue_task_fair(struct rq *rq, struct task_struct *p, int flags)
 		inc_nr_running(rq);
 	}
 
-	inc_cpu_capacity(task_cpu(p));
+	inc_cpu_capacity(task_cpu(p), p);
 	hrtick_update(rq);
 }
 
@@ -2986,7 +2992,7 @@ static void dequeue_task_fair(struct rq *rq, struct task_struct *p, int flags)
 		update_rq_runnable_avg(rq, 1);
 	}
 
-	dec_cpu_capacity(task_cpu(p));
+	dec_cpu_capacity(task_cpu(p), p);
 	hrtick_update(rq);
 }
 
@@ -5772,7 +5778,7 @@ static void run_rebalance_domains(struct softirq_action *h)
 	 */
 	nohz_idle_balance(this_cpu, idle);
 
-	inc_cpu_capacity(this_cpu);
+	inc_cpu_capacity(this_cpu, NULL);
 	power_late_callback(this_cpu);
 }
 
-- 
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