__schedule changes
authorRené Sechting <sechting@mailbox.tu-berlin.de>
Fri, 13 Dec 2013 14:47:45 +0000 (15:47 +0100)
committerRené Sechting <sechting@mailbox.tu-berlin.de>
Fri, 13 Dec 2013 14:47:45 +0000 (15:47 +0100)
just reimplemented some stuff inside the core.c to let the framework
do the nasty scheduling work

kernel/sched/modsched/core.c

index 66d77ef..ec5473e 100644 (file)
@@ -1665,10 +1665,11 @@ need_resched:
                //tick
                //printk("tick on cpu: %d\n",cpu);
 //             next = (struct task_struct *)send_to_topic(3);
-               fw_notify(FW_TIMEOUT,prev->fw_task);
+//             fw_notify(FW_TIMEOUT,prev->fw_task);
        }
 
-       pre_schedule(rq, prev);
+       fw_notify(FW_DISPATCH, NULL);
+//     pre_schedule(rq, prev);
 
 //     if (unlikely(!rq->nr_running))
 //             idle_balance(cpu, rq);
@@ -1692,36 +1693,36 @@ need_resched:
 //             next = rq->idle;
        }
 */
-       if(next)
-               next->se.exec_start = rq->clock_task;
-
-       clear_tsk_need_resched(prev);
-       rq->skip_clock_update = 0;
-
-       if (likely(prev != next)&&(next!=NULL)) {
-               rq->nr_switches++;
-               rq->curr = next;
-//             ++*switch_count;
-
-//             printk("wechsel! PID: %d | CPU :%d | allows: %d\n",next->pid, cpu, next->cpus_allowed);
-               context_switch(rq, prev, next); /* unlocks the rq */
-
-               // TODO: remove irq enable
-               arch_local_irq_enable();
-
-               /*
-                * The context switch have flipped the stack from under us
-                * and restored the local variables which were saved when
-                * this task called schedule() in the past. prev == current
-                * is still correct, but it can be moved to another cpu/rq.
-                */
-               cpu = smp_processor_id();
-               rq = cpu_rq(cpu);
-       }
-       else
-               raw_spin_unlock_irq(&rq->lock);
-
-       post_schedule(rq);
+//     if(next)
+//             next->se.exec_start = rq->clock_task;
+//
+//     clear_tsk_need_resched(prev);
+//     rq->skip_clock_update = 0;
+//
+//     if (likely(prev != next)&&(next!=NULL)) {
+//             rq->nr_switches++;
+//             rq->curr = next;
+////           ++*switch_count;
+//
+////           printk("wechsel! PID: %d | CPU :%d | allows: %d\n",next->pid, cpu, next->cpus_allowed);
+//             context_switch(rq, prev, next); /* unlocks the rq */
+//
+//             // TODO: remove irq enable
+//             arch_local_irq_enable();
+//
+//             /*
+//              * The context switch have flipped the stack from under us
+//              * and restored the local variables which were saved when
+//              * this task called schedule() in the past. prev == current
+//              * is still correct, but it can be moved to another cpu/rq.
+//              */
+//             cpu = smp_processor_id();
+//             rq = cpu_rq(cpu);
+//     }
+//     else
+//             raw_spin_unlock_irq(&rq->lock);
+//
+//     post_schedule(rq);
 
        sched_preempt_enable_no_resched();
        if (need_resched())