]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - kernel/sched/stop_task.c
Merge branch 'x86-entry-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux.git] / kernel / sched / stop_task.c
index c183b790ca54a90151d60b4cf1866143b4f3cfb8..7e1cee4e65b211ece98bd640bf691a29de329ed1 100644 (file)
@@ -23,17 +23,22 @@ check_preempt_curr_stop(struct rq *rq, struct task_struct *p, int flags)
        /* we're never preempted */
 }
 
+static void set_next_task_stop(struct rq *rq, struct task_struct *stop)
+{
+       stop->se.exec_start = rq_clock_task(rq);
+}
+
 static struct task_struct *
 pick_next_task_stop(struct rq *rq, struct task_struct *prev, struct rq_flags *rf)
 {
        struct task_struct *stop = rq->stop;
 
+       WARN_ON_ONCE(prev || rf);
+
        if (!stop || !task_on_rq_queued(stop))
                return NULL;
 
-       put_prev_task(rq, prev);
-
-       stop->se.exec_start = rq_clock_task(rq);
+       set_next_task_stop(rq, stop);
 
        return stop;
 }
@@ -55,7 +60,7 @@ static void yield_task_stop(struct rq *rq)
        BUG(); /* the stop task should never yield, its pointless. */
 }
 
-static void put_prev_task_stop(struct rq *rq, struct task_struct *prev)
+static void put_prev_task_stop(struct rq *rq, struct task_struct *prev, struct rq_flags *rf)
 {
        struct task_struct *curr = rq->curr;
        u64 delta_exec;
@@ -86,13 +91,6 @@ static void task_tick_stop(struct rq *rq, struct task_struct *curr, int queued)
 {
 }
 
-static void set_curr_task_stop(struct rq *rq)
-{
-       struct task_struct *stop = rq->stop;
-
-       stop->se.exec_start = rq_clock_task(rq);
-}
-
 static void switched_to_stop(struct rq *rq, struct task_struct *p)
 {
        BUG(); /* its impossible to change to this class */
@@ -128,13 +126,13 @@ const struct sched_class stop_sched_class = {
 
        .pick_next_task         = pick_next_task_stop,
        .put_prev_task          = put_prev_task_stop,
+       .set_next_task          = set_next_task_stop,
 
 #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,
        .task_tick              = task_tick_stop,
 
        .get_rr_interval        = get_rr_interval_stop,