Cleaning up the core.c
authorDaniel Röhrig <daniel.roehrig@mailbox.tu-berlin.de>
Thu, 14 Nov 2013 16:59:31 +0000 (17:59 +0100)
committerDaniel Röhrig <daniel.roehrig@mailbox.tu-berlin.de>
Thu, 14 Nov 2013 16:59:31 +0000 (17:59 +0100)
Comments seem unnescessaryarsys (how do you spell that?)

kernel/sched.new/core.c

index 66f6b56..558fa68 100644 (file)
@@ -1617,10 +1617,10 @@ static void __sched __schedule(void)
        int cpu;
 
 need_resched:
-       preempt_disable();
+       preempt_disable();//Important, calls __barrier
        cpu = smp_processor_id();
        rq = cpu_rq(cpu);
-       rcu_note_context_switch(cpu);
+//     rcu_note_context_switch(cpu);//May be important for SMP?
        prev = rq->curr;
 
        raw_spin_lock_irq(&rq->lock);
@@ -1647,20 +1647,15 @@ need_resched:
        }
 
        if(prev->state & TASK_DEAD){
-               //task dead
                send_to_topic(2,prev);
        }else if(prev->state && !(preempt_count() & PREEMPT_ACTIVE)){
                //yield
                send_to_topic(4,prev);
-//             printk("yield next\n");
        }else{
                //tick
                send_to_topic(3,NULL);
-//             printk("tick next\n");
        }
 
-       pre_schedule(rq, prev);
-
        cpu = smp_processor_id();
        rq = cpu_rq(cpu);
        prev = rq->prev;
@@ -1668,11 +1663,9 @@ need_resched:
 
        clear_tsk_need_resched(prev);
        rq->skip_clock_update = 0;
-//
-//     if (likely(prev != next)&&(next!=NULL)) {
+
        if (likely(prev != next)) {
 
-//             // TODO: remove irq enable
                arch_local_irq_enable();
 //
 //             /*
@@ -1683,9 +1676,7 @@ need_resched:
 //              */
                cpu = smp_processor_id();
                rq = cpu_rq(cpu);
-       }
-       else{
-//             printk("ELSE");
+       }else{
                raw_spin_unlock_irq(&rq->lock);
        }
        post_schedule(rq);