Merge commit '8700c95adb03' into timers/nohz
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / kernel / sched / sched.h
index 4c225c4c7111d7baaa3dfa3d4ec0b3f9a966c593..24dc2989774937be3f1161541d8fb8860aeec4d0 100644 (file)
@@ -5,6 +5,7 @@
 #include <linux/mutex.h>
 #include <linux/spinlock.h>
 #include <linux/stop_machine.h>
+#include <linux/tick.h>
 
 #include "cpupri.h"
 #include "cpuacct.h"
@@ -405,7 +406,7 @@ struct rq {
        #define CPU_LOAD_IDX_MAX 5
        unsigned long cpu_load[CPU_LOAD_IDX_MAX];
        unsigned long last_load_update_tick;
-#ifdef CONFIG_NO_HZ
+#ifdef CONFIG_NO_HZ_COMMON
        u64 nohz_stamp;
        unsigned long nohz_flags;
 #endif
@@ -1072,6 +1073,16 @@ static inline u64 steal_ticks(u64 steal)
 static inline void inc_nr_running(struct rq *rq)
 {
        rq->nr_running++;
+
+#ifdef CONFIG_NO_HZ_FULL
+       if (rq->nr_running == 2) {
+               if (tick_nohz_full_cpu(rq->cpu)) {
+                       /* Order rq->nr_running write against the IPI */
+                       smp_wmb();
+                       smp_send_reschedule(rq->cpu);
+               }
+       }
+#endif
 }
 
 static inline void dec_nr_running(struct rq *rq)
@@ -1299,7 +1310,7 @@ extern void init_rt_rq(struct rt_rq *rt_rq, struct rq *rq);
 
 extern void account_cfs_bandwidth_used(int enabled, int was_enabled);
 
-#ifdef CONFIG_NO_HZ
+#ifdef CONFIG_NO_HZ_COMMON
 enum rq_nohz_flag_bits {
        NOHZ_TICK_STOPPED,
        NOHZ_BALANCE_KICK,