aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2013-04-20 08:35:09 -0400
committerFrederic Weisbecker <fweisbec@gmail.com>2013-04-22 14:06:54 -0400
commit9f3660c2c1a221c886474587103c69f6034d3e4f (patch)
tree23906ee91599b6b04e85523064428f59b3e62be1 /kernel/sched
parent026249ef100b5384b6c74c360db46728e98354da (diff)
sched: Kick full dynticks CPU that have more than one task enqueued.
Kick the tick on full dynticks CPUs when they get more than one task running on their queue. This makes sure that local fairness is maintained by the tick on the destination. This is done regardless of these tasks' class. We should be able to be more clever in the future depending on these. eg: a CPU that runs a SCHED_FIFO task doesn't need to maintain fairness against local pending tasks of the fair class. But keep things simple for now. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Chris Metcalf <cmetcalf@tilera.com> Cc: Christoph Lameter <cl@linux.com> Cc: Geoff Levand <geoff@infradead.org> Cc: Gilad Ben Yossef <gilad@benyossef.com> Cc: Hakan Akkan <hakanakkan@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Kevin Hilman <khilman@linaro.org> Cc: Li Zhong <zhong@linux.vnet.ibm.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Paul Gortmaker <paul.gortmaker@windriver.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/sched')
-rw-r--r--kernel/sched/sched.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 889904dd6d77..eb363aa5d83c 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -5,6 +5,7 @@
5#include <linux/mutex.h> 5#include <linux/mutex.h>
6#include <linux/spinlock.h> 6#include <linux/spinlock.h>
7#include <linux/stop_machine.h> 7#include <linux/stop_machine.h>
8#include <linux/tick.h>
8 9
9#include "cpupri.h" 10#include "cpupri.h"
10 11
@@ -1106,6 +1107,16 @@ static inline u64 steal_ticks(u64 steal)
1106static inline void inc_nr_running(struct rq *rq) 1107static inline void inc_nr_running(struct rq *rq)
1107{ 1108{
1108 rq->nr_running++; 1109 rq->nr_running++;
1110
1111#ifdef CONFIG_NO_HZ_FULL
1112 if (rq->nr_running == 2) {
1113 if (tick_nohz_full_cpu(rq->cpu)) {
1114 /* Order rq->nr_running write against the IPI */
1115 smp_wmb();
1116 smp_send_reschedule(rq->cpu);
1117 }
1118 }
1119#endif
1109} 1120}
1110 1121
1111static inline void dec_nr_running(struct rq *rq) 1122static inline void dec_nr_running(struct rq *rq)