Merge tag 'v4.3' into p/abusse/merge_upgrade
[projects/modsched/linux.git] / kernel / sched / cfs / stop_task.c
index 47197de..cbc67da 100644 (file)
@@ -23,28 +23,31 @@ check_preempt_curr_stop(struct rq *rq, struct task_struct *p, int flags)
        /* we're never preempted */
 }
 
-static struct task_struct *pick_next_task_stop(struct rq *rq)
+static struct task_struct *
+pick_next_task_stop(struct rq *rq, struct task_struct *prev)
 {
        struct task_struct *stop = rq->stop;
 
-       if (stop && stop->on_rq) {
-               stop->se.exec_start = rq_clock_task(rq);
-               return stop;
-       }
+       if (!stop || !task_on_rq_queued(stop))
+               return NULL;
 
-       return NULL;
+       put_prev_task(rq, prev);
+
+       stop->se.exec_start = rq_clock_task(rq);
+
+       return stop;
 }
 
 static void
 enqueue_task_stop(struct rq *rq, struct task_struct *p, int flags)
 {
-       inc_nr_running(rq);
+       add_nr_running(rq, 1);
 }
 
 static void
 dequeue_task_stop(struct rq *rq, struct task_struct *p, int flags)
 {
-       dec_nr_running(rq);
+       sub_nr_running(rq, 1);
 }
 
 static void yield_task_stop(struct rq *rq)
@@ -99,11 +102,15 @@ get_rr_interval_stop(struct rq *rq, struct task_struct *task)
        return 0;
 }
 
+static void update_curr_stop(struct rq *rq)
+{
+}
+
 /*
  * Simple, special scheduling class for the per-CPU stop tasks:
  */
 const struct sched_class stop_sched_class = {
-       .next                   = &rt_sched_class,
+       .next                   = &dl_sched_class,
 
        .enqueue_task           = enqueue_task_stop,
        .dequeue_task           = dequeue_task_stop,
@@ -116,6 +123,7 @@ const struct sched_class stop_sched_class = {
 
 #ifdef CONFIG_SMP
        .select_task_rq         = select_task_rq_stop,
+       .set_cpus_allowed       = set_cpus_allowed_common,
 #endif
 
        .set_curr_task          = set_curr_task_stop,
@@ -125,4 +133,5 @@ const struct sched_class stop_sched_class = {
 
        .prio_changed           = prio_changed_stop,
        .switched_to            = switched_to_stop,
+       .update_curr            = update_curr_stop,
 };