smp framework running? cant be true...
authorRené Sechting <sechting@mailbox.tu-berlin.de>
Thu, 10 Oct 2013 13:52:52 +0000 (15:52 +0200)
committerRené Sechting <sechting@mailbox.tu-berlin.de>
Thu, 10 Oct 2013 13:52:52 +0000 (15:52 +0200)
siehe titel

kernel/sched.new/core.c
run_qemu

index 0accbbc..dbb3fcc 100644 (file)
 #include "../workqueue_internal.h"
 #include "../smpboot.h"
 
+/*
+ * FRAMEWORK STUFF
+ */
+void init_modsched_framework(void* idletask);
+void *send_to_topic(int topic_id, ...);
 
 //
 // Variables
@@ -307,6 +312,10 @@ void sched_init(void)
 #endif
 //     init_sched_fair_class();
 
+       //TODO: FRAMEORK
+       init_modsched_framework(current);
+
+
        scheduler_running = 1;
 }
 
@@ -1319,6 +1328,9 @@ void wake_up_new_task(struct task_struct *p)
 
 #endif
 
+       //TODO: FRAMEWORK ZEUGS
+       send_to_topic(1,p);
+
        rq = __task_rq_lock(p);
        activate_task(rq, p, 0);
        p->on_rq = 1;
@@ -1412,6 +1424,9 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags)
        }
 #endif /* CONFIG_SMP */
 
+       //TODO: FRAMEWORK
+       send_to_topic(0,p);
+
        ttwu_queue(p, cpu);
 stat:
 //     raw_spin_unlock(&rq->lock);
@@ -1599,6 +1614,17 @@ need_resched:
 //             switch_count = &prev->nvcsw;
        }
 
+       if(prev->flags & TASK_DEAD){
+               //task dead
+               next = (struct task_struct *)send_to_topic(2,prev);
+       }else if(prev->state && !(preempt_count() & PREEMPT_ACTIVE)){
+               //yield
+               next = (struct task_struct *)send_to_topic(4,prev);
+       }else{
+               //tick
+               next = (struct task_struct *)send_to_topic(3);
+       }
+
        pre_schedule(rq, prev);
 
 //     if (unlikely(!rq->nr_running))
@@ -1618,16 +1644,16 @@ need_resched:
                next = list_first_entry(&rq->rq_list, struct task_struct, rq_tasks);
                list_del(&next->rq_tasks);
        }
-       else {
+/*     else {
                next = rq->idle;
        }
        next->se.exec_start = rq->clock_task;
-
+*/
 
        clear_tsk_need_resched(prev);
        rq->skip_clock_update = 0;
 
-       if (likely(prev != next)) {
+       if (likely(prev != next)&&(next!=NULL)) {
                rq->nr_switches++;
                rq->curr = next;
 //             ++*switch_count;
index 5825200..ccb9a46 100755 (executable)
--- a/run_qemu
+++ b/run_qemu
@@ -1,4 +1,4 @@
 #!/bin/sh
 
 #qemu-system-x86_64 -machine accel=tcg -nographic -kernel build/arch/x86_64/boot/bzImage -append "console=ttyS0 init=/bin/busybox sh" --enable-kvm
-qemu-system-x86_64 -nographic -kernel build/arch/x86_64/boot/bzImage -append "console=ttyS0" --enable-kvm
+qemu-system-x86_64 -nographic -kernel build/arch/x86_64/boot/bzImage -append "console=ttyS0" --enable-kvm -smp 2,maxcpu=2,cores=2,threads=1,sockets=1