Added new runqueue
[projects/modsched/linux.git] / kernel / sched.new / core.c
index 2563010..d2a2e4d 100644 (file)
@@ -111,6 +111,8 @@ void sched_init(void)
 
                rq = cpu_rq(i);
 
+               INIT_LIST_HEAD(&rq->rq_list);
+
 //             raw_spin_lock_init(&rq->lock);
                rq->nr_running = 0;
 
@@ -204,7 +206,6 @@ void sched_fork(struct task_struct *p)
        p->se.exec_start                = 0;
        p->se.sum_exec_runtime          = 0;
        p->se.prev_sum_exec_runtime     = 0;
-       p->se.nr_migrations             = 0;
        p->se.vruntime                  = 0;
        INIT_LIST_HEAD(&p->se.group_node);
 
@@ -568,7 +569,7 @@ void wake_up_new_task(struct task_struct *tsk)
 {
        struct rq *rq = cpu_rq(0);
 
-       //TODO: add new linked list to hold tasks
+       list_add_tail(tsk->se->group_node, rq->rq_list);
        tsk->on_rq = 1;
 }
 
@@ -728,7 +729,7 @@ static void __sched __schedule(void)
 
 //     put_prev_task(rq, prev);
 //     next = pick_next_task(rq);
-       next = (struct task_struct*)rq->curr->tasks.next;
+       next = rq->rq_list->
 //     clear_tsk_need_resched(prev);
        rq->skip_clock_update = 0;