From c2ec2800bc40134cbc7ffeef499e6659a7f24821 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Tue, 20 Sep 2011 08:56:58 +0200 Subject: [PATCH 01/11] determine the 1, 5 and 15 minute load --- include/metalsvm/tasks_types.h | 2 +- kernel/tasks.c | 34 ++++++++++++++++++++++------------ 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/include/metalsvm/tasks_types.h b/include/metalsvm/tasks_types.h index 6813896e..3e0253cd 100644 --- a/include/metalsvm/tasks_types.h +++ b/include/metalsvm/tasks_types.h @@ -123,7 +123,7 @@ typedef struct { /// total number of tasks in the queue uint32_t nr_tasks; // current load = average number of tasks in the queue (1-minute average) - uint32_t load; + uint32_t load[3]; // help counter to determine the the cpu load int32_t load_counter; // help counter to avoid "over balancing" diff --git a/kernel/tasks.c b/kernel/tasks.c index 039d7ad1..813ca08c 100644 --- a/kernel/tasks.c +++ b/kernel/tasks.c @@ -53,11 +53,11 @@ static task_t task_table[MAX_TASKS] = { \ static spinlock_irqsave_t table_lock = SPINLOCK_IRQSAVE_INIT; #if MAX_CORES > 1 static runqueue_t runqueues[MAX_CORES] = { \ - [0] = {task_table+0, NULL, 0, 0, 0, 0, 0, {[0 ... MAX_PRIO-1] = {NULL, NULL}}, {NULL, NULL}, SPINLOCK_IRQSAVE_INIT}, \ - [1 ... MAX_CORES-1] = {NULL, NULL, 0, 0, 0, 0, 0, {[0 ... MAX_PRIO-1] = {NULL, NULL}}, {NULL, NULL}, SPINLOCK_IRQSAVE_INIT}}; + [0] = {task_table+0, NULL, 0, {[0 ... 2] = 0}, TIMER_FREQ/5, 0, 0, {[0 ... MAX_PRIO-1] = {NULL, NULL}}, {NULL, NULL}, SPINLOCK_IRQSAVE_INIT}, \ + [1 ... MAX_CORES-1] = {NULL, NULL, 0, {[0 ... 2] = 0}, TIMER_FREQ/5, 0, 0, {[0 ... MAX_PRIO-1] = {NULL, NULL}}, {NULL, NULL}, SPINLOCK_IRQSAVE_INIT}}; #else static runqueue_t runqueues[1] = { \ - [0] = {task_table+0, NULL, 0, 0, 0, 0, 0, {[0 ... MAX_PRIO-1] = {NULL, NULL}}, {NULL, NULL}, SPINLOCK_IRQSAVE_INIT}}; + [0] = {task_table+0, NULL, 0, {[0 ... 2] = 0}, TIMER_FREQ/5, 0, 0, {[0 ... MAX_PRIO-1] = {NULL, NULL}}, {NULL, NULL}, SPINLOCK_IRQSAVE_INIT}}; #endif DEFINE_PER_CORE(task_t*, current_task, task_table+0); @@ -1079,27 +1079,37 @@ int set_timer(uint64_t deadline) return ret; } -#define FSHIFT 21 /* nr of bits of precision (e.g. 11) */ -#define FIXED_1 (1< 0) runqueues[core_id].balance_counter--; + + runqueues[core_id].load_counter--; if (runqueues[core_id].load_counter < 0) { - runqueues[core_id].load_counter += 5*TIMER_FREQ; + runqueues[core_id].load_counter += TIMER_FREQ/5 + 1; spinlock_irqsave_lock(&runqueues[core_id].lock); - runqueues[core_id].load *= EXP; - runqueues[core_id].load += runqueues[core_id].nr_tasks*(FIXED_1-EXP); - runqueues[core_id].load >>= FSHIFT; + runqueues[core_id].load[0] *= EXP_1; + runqueues[core_id].load[0] += (runqueues[core_id].nr_tasks *FIXED_1) * (FIXED_1 - EXP_1); + runqueues[core_id].load[0] >>= FSHIFT; + runqueues[core_id].load[1] *= EXP_5; + runqueues[core_id].load[1] += (runqueues[core_id].nr_tasks *FIXED_1) * (FIXED_1 - EXP_5); + runqueues[core_id].load[1] >>= FSHIFT; + runqueues[core_id].load[2] *= EXP_15; + runqueues[core_id].load[2] += (runqueues[core_id].nr_tasks *FIXED_1) * (FIXED_1 - EXP_15); + runqueues[core_id].load[2] >>= FSHIFT; spinlock_irqsave_unlock(&runqueues[core_id].lock); - //kprintf("load of core %u: %u, %u\n", core_id, runqueues[core_id].load, runqueues[core_id].nr_tasks); + kprintf("load of core %u: %u, %u, %u, %u\n", core_id, runqueues[core_id].load[0], runqueues[core_id].load[1], runqueues[core_id].load[2], runqueues[core_id].nr_tasks); } } From ef3ab5b8364d908424fd3b0123fb346b0a95a999 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Tue, 20 Sep 2011 14:37:28 +0200 Subject: [PATCH 02/11] first steps to realize load balancing --- kernel/tasks.c | 36 +++++++++++++++++------------------- kernel/tests.c | 8 +++++--- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/kernel/tasks.c b/kernel/tasks.c index 813ca08c..bb59b3b0 100644 --- a/kernel/tasks.c +++ b/kernel/tasks.c @@ -53,11 +53,11 @@ static task_t task_table[MAX_TASKS] = { \ static spinlock_irqsave_t table_lock = SPINLOCK_IRQSAVE_INIT; #if MAX_CORES > 1 static runqueue_t runqueues[MAX_CORES] = { \ - [0] = {task_table+0, NULL, 0, {[0 ... 2] = 0}, TIMER_FREQ/5, 0, 0, {[0 ... MAX_PRIO-1] = {NULL, NULL}}, {NULL, NULL}, SPINLOCK_IRQSAVE_INIT}, \ - [1 ... MAX_CORES-1] = {NULL, NULL, 0, {[0 ... 2] = 0}, TIMER_FREQ/5, 0, 0, {[0 ... MAX_PRIO-1] = {NULL, NULL}}, {NULL, NULL}, SPINLOCK_IRQSAVE_INIT}}; + [0] = {task_table+0, NULL, 0, {[0 ... 2] = 0}, TIMER_FREQ/5, TIMER_FREQ/2, 0, {[0 ... MAX_PRIO-1] = {NULL, NULL}}, {NULL, NULL}, SPINLOCK_IRQSAVE_INIT}, \ + [1 ... MAX_CORES-1] = {NULL, NULL, 0, {[0 ... 2] = 0}, TIMER_FREQ/5, TIMER_FREQ/2, 0, {[0 ... MAX_PRIO-1] = {NULL, NULL}}, {NULL, NULL}, SPINLOCK_IRQSAVE_INIT}}; #else static runqueue_t runqueues[1] = { \ - [0] = {task_table+0, NULL, 0, {[0 ... 2] = 0}, TIMER_FREQ/5, 0, 0, {[0 ... MAX_PRIO-1] = {NULL, NULL}}, {NULL, NULL}, SPINLOCK_IRQSAVE_INIT}}; + [0] = {task_table+0, NULL, 0, {[0 ... 2] = 0}, TIMER_FREQ/5, TIMER_FREQ/2, 0, {[0 ... MAX_PRIO-1] = {NULL, NULL}}, {NULL, NULL}, SPINLOCK_IRQSAVE_INIT}}; #endif DEFINE_PER_CORE(task_t*, current_task, task_table+0); @@ -1109,7 +1109,7 @@ void update_load(void) runqueues[core_id].load[2] >>= FSHIFT; spinlock_irqsave_unlock(&runqueues[core_id].lock); - kprintf("load of core %u: %u, %u, %u, %u\n", core_id, runqueues[core_id].load[0], runqueues[core_id].load[1], runqueues[core_id].load[2], runqueues[core_id].nr_tasks); + //kprintf("load of core %u: %u, %u, %u, %u\n", core_id, runqueues[core_id].load[0], runqueues[core_id].load[1], runqueues[core_id].load[2], runqueues[core_id].nr_tasks); } } @@ -1118,24 +1118,23 @@ extern atomic_int32_t cpu_online; void load_balancing(void) { -#if 0 uint32_t i, core_id = CORE_ID; uint32_t prio; task_t* task; - spinlock_lock(&runqueues[core_id].lock); + spinlock_irqsave_lock(&runqueues[core_id].lock); for(i=0; (i runqueues[core_id].load) { - kprintf("Try to steal a task from core %u (load %u) to %u (load %u)\n", i, runqueues[i].load, core_id, runqueues[core_id].load); + spinlock_irqsave_lock(&runqueues[i].lock); + if ((runqueues[i].load[0] >> (FSHIFT-1)) > (runqueues[core_id].load[0] >> (FSHIFT-1))) { + kprintf("Try to steal a task from core %u (load %u) to %u (load %u)\n", i, runqueues[i].load[0], core_id, runqueues[core_id].load[0]); kprintf("Task on core %u: %u, core %u, %u\n", i, runqueues[i].nr_tasks, core_id, runqueues[i].nr_tasks); - prio = last_set(runqueues[i].prio_bitmap); - if (prio) { + prio = msb(runqueues[i].prio_bitmap); + if (prio < sizeof(size_t)*8) { // steal a ready task task = runqueues[i].queue[prio-1].last; kprintf("Try to steal a ready task %d\n", task->id); @@ -1161,8 +1160,8 @@ void load_balancing(void) // update task counters runqueues[core_id].nr_tasks++; runqueues[i].nr_tasks--; - runqueues[core_id].balance_counter = 5*TIMER_FREQ; - } else { + runqueues[core_id].balance_counter = TIMER_FREQ/2; + } /*else { task_t* tmp; // steal a blocked task @@ -1207,14 +1206,13 @@ void load_balancing(void) // update task counters runqueues[core_id].nr_tasks++; runqueues[i].nr_tasks--; - runqueues[core_id].balance_counter = 5*TIMER_FREQ; - } + runqueues[core_id].balance_counter = TIMER_FREQ/2; + }*/ } no_task_found: - spinlock_unlock(&runqueues[i].lock); + spinlock_irqsave_unlock(&runqueues[i].lock); } - spinlock_unlock(&runqueues[core_id].lock); -#endif + spinlock_irqsave_unlock(&runqueues[core_id].lock); } #endif diff --git a/kernel/tests.c b/kernel/tests.c index e8390fa6..345ebfc7 100644 --- a/kernel/tests.c +++ b/kernel/tests.c @@ -91,6 +91,8 @@ static int foo(void* arg) sleep(1); } + while(1); + return 42; } @@ -278,7 +280,7 @@ int test_init(void) { // char* argv[] = {"/bin/mshell", NULL}; char* argv[] = {"/bin/tests", NULL}; -// char* server_argv[] = {"/bin/server", "6789", NULL}; + char* server_argv[] = {"/bin/server", "6789", NULL}; // char* client_argv[] = {"/bin/client", "127.0.0.1", "6789", NULL}; sem_init(&producing, 1); @@ -294,9 +296,9 @@ int test_init(void) //create_kernel_task(NULL, svm_test, NULL, NORMAL_PRIO); //create_user_task(NULL, "/bin/hello", argv); create_user_task(NULL, "/bin/tests", argv); - //create_user_task(NULL, "/bin/jacobi", argv); + create_user_task(NULL, "/bin/jacobi", argv); //create_user_task(NULL, "/bin/mshell", argv); - //create_user_task(NULL, "/bin/jacobi", argv); + create_user_task(NULL, "/bin/jacobi", argv); //create_user_task(NULL, "/bin/server", server_argv); //sleep(5); //create_user_task(NULL, "/bin/client", client_argv); From 670b3f850c93dde7257d88fc7b688d95d5e1e18c Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Thu, 22 Sep 2011 09:48:40 +0200 Subject: [PATCH 03/11] add first version of our load balancer --- kernel/tasks.c | 41 ++++++++++++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/kernel/tasks.c b/kernel/tasks.c index bb59b3b0..b7ba3672 100644 --- a/kernel/tasks.c +++ b/kernel/tasks.c @@ -1115,9 +1115,33 @@ void update_load(void) #if MAX_CORES > 1 extern atomic_int32_t cpu_online; +#endif +void dump_load(void) +{ + uint32_t i; +#if MAX_CORES > 1 + uint32_t ncores = atomic_int32_read(&cpu_online); +#else + uint32_t ncores = 1; +#endif + + for(i=0; i> FSHIFT, + ((runqueues[i].load[0] & ((1 << FSHIFT) - 1)) * 100) / (1 << FSHIFT), + runqueues[i].load[1] >> FSHIFT, + ((runqueues[i].load[1] & ((1 << FSHIFT) - 1)) * 100) / (1 << FSHIFT), + runqueues[i].load[2] >> FSHIFT, + ((runqueues[i].load[2] & ((1 << FSHIFT) - 1)) * 100) / (1 << FSHIFT)); + } +} + +#if MAX_CORES > 1 void load_balancing(void) { +#if 1 uint32_t i, core_id = CORE_ID; uint32_t prio; task_t* task; @@ -1133,18 +1157,19 @@ void load_balancing(void) kprintf("Try to steal a task from core %u (load %u) to %u (load %u)\n", i, runqueues[i].load[0], core_id, runqueues[core_id].load[0]); kprintf("Task on core %u: %u, core %u, %u\n", i, runqueues[i].nr_tasks, core_id, runqueues[i].nr_tasks); - prio = msb(runqueues[i].prio_bitmap); + prio = lsb(runqueues[i].prio_bitmap); if (prio < sizeof(size_t)*8) { // steal a ready task task = runqueues[i].queue[prio-1].last; - kprintf("Try to steal a ready task %d\n", task->id); + kprintf("Try to steal a ready task %d with prio %u\n", task->id, prio); // remove last element from queue i if (task->prev) task->prev->next = NULL; - runqueues[i].queue[prio-1].last = task->prev; - if (!runqueues[i].queue[prio-1].last) - runqueues[i].queue[prio-1].first = NULL; + if (runqueues[i].queue[prio-1].first == task) { + runqueues[i].queue[prio-1].first = runqueues[i].queue[prio-1].last = NULL; + runqueues[i].prio_bitmap &= ~(1 << prio); + } else runqueues[i].queue[prio-1].last = task->prev; // add task at the end of queue core_id if (!runqueues[core_id].queue[prio-1].last) { @@ -1156,12 +1181,13 @@ void load_balancing(void) runqueues[core_id].queue[prio-1].last = task; task->next = NULL; } + runqueues[core_id].prio_bitmap |= (1 << prio); // update task counters runqueues[core_id].nr_tasks++; runqueues[i].nr_tasks--; runqueues[core_id].balance_counter = TIMER_FREQ/2; - } /*else { + } else { task_t* tmp; // steal a blocked task @@ -1207,12 +1233,13 @@ void load_balancing(void) runqueues[core_id].nr_tasks++; runqueues[i].nr_tasks--; runqueues[core_id].balance_counter = TIMER_FREQ/2; - }*/ + } } no_task_found: spinlock_irqsave_unlock(&runqueues[i].lock); } spinlock_irqsave_unlock(&runqueues[core_id].lock); +#endif } #endif From de02bffaa9d8b9b219d89db2017ffad1e15bb812 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Thu, 22 Sep 2011 09:49:46 +0200 Subject: [PATCH 04/11] simplify our test cases --- kernel/tests.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kernel/tests.c b/kernel/tests.c index 345ebfc7..a7400ca7 100644 --- a/kernel/tests.c +++ b/kernel/tests.c @@ -87,12 +87,10 @@ static int foo(void* arg) return 0; for(i=0; i<5; i++) { - kprintf("Message from core %d: %s\n", smp_id(), (char*) arg); + kprintf("%s\n", (char*) arg); sleep(1); } - while(1); - return 42; } From 50315a1d20e99a3751e44ed79dcae33439e82331 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Thu, 22 Sep 2011 10:58:03 +0200 Subject: [PATCH 05/11] dump every minute the average cpu load --- arch/x86/kernel/timer.c | 6 +++++- include/metalsvm/tasks.h | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/timer.c b/arch/x86/kernel/timer.c index 70f62b1c..a2d4ed9f 100644 --- a/arch/x86/kernel/timer.c +++ b/arch/x86/kernel/timer.c @@ -79,12 +79,16 @@ static void timer_handler(struct state *s) /*if (timer_ticks % TIMER_FREQ == 0) { vga_puts("One second has passed\n"); }*/ + + /* Dump load every minute */ + if (timer_ticks % (TIMER_FREQ*60) == 0) + dump_load(); } update_load(); #if MAX_CORES > 1 - if ((atomic_int32_read(&cpu_online) > 1) && (timer_ticks % (TIMER_FREQ/5) == 0)) + if (atomic_int32_read(&cpu_online) > 1) load_balancing(); #endif } diff --git a/include/metalsvm/tasks.h b/include/metalsvm/tasks.h index 3f4589cb..55056cbd 100644 --- a/include/metalsvm/tasks.h +++ b/include/metalsvm/tasks.h @@ -92,6 +92,11 @@ tid_t wait(int32_t* result); */ void update_load(void); +/** @brief Print the current cpu load + * + */ +void dump_load(void); + #if MAX_CORES > 1 /** @brief Load balancer * @@ -103,7 +108,8 @@ void load_balancing(void); /** @brief Task switcher * - * Timer-interrupted use of this function for task switching */ + * Timer-interrupted use of this function for task switching + */ void scheduler(void); /** @brief Wake up a blocked task From b9a9c155b3d3485bc9b7fed87ef5d45f4c78ba98 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Thu, 22 Sep 2011 10:58:54 +0200 Subject: [PATCH 06/11] test cases should not use the same priority like the tcpip thread => reduce theire priorities --- kernel/tests.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/tests.c b/kernel/tests.c index a7400ca7..2bdd4d46 100644 --- a/kernel/tests.c +++ b/kernel/tests.c @@ -262,7 +262,7 @@ static int join_test(void* arg) tid_t id, ret; int result = -1234; - create_kernel_task(&id, foo, "Hello from foo2", HIGH_PRIO); + create_kernel_task(&id, foo, "Hello from foo2", HIGH_PRIO-1); kprintf("Wait for child %u\n", id); do { From d7dc5ec9b7d94b67085de28fc4ed16bd2c77f97a Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Thu, 22 Sep 2011 11:01:33 +0200 Subject: [PATCH 07/11] fine tuning of our load balancer --- kernel/tasks.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/kernel/tasks.c b/kernel/tasks.c index b7ba3672..db30571f 100644 --- a/kernel/tasks.c +++ b/kernel/tasks.c @@ -1090,12 +1090,11 @@ void update_load(void) { uint32_t core_id = CORE_ID; - if (runqueues[core_id].balance_counter > 0) - runqueues[core_id].balance_counter--; - + runqueues[core_id].balance_counter--; runqueues[core_id].load_counter--; - if (runqueues[core_id].load_counter < 0) { - runqueues[core_id].load_counter += TIMER_FREQ/5 + 1; + + if (runqueues[core_id].load_counter <= 0) { + runqueues[core_id].load_counter += TIMER_FREQ/5; spinlock_irqsave_lock(&runqueues[core_id].lock); runqueues[core_id].load[0] *= EXP_1; @@ -1154,14 +1153,14 @@ void load_balancing(void) spinlock_irqsave_lock(&runqueues[i].lock); if ((runqueues[i].load[0] >> (FSHIFT-1)) > (runqueues[core_id].load[0] >> (FSHIFT-1))) { - kprintf("Try to steal a task from core %u (load %u) to %u (load %u)\n", i, runqueues[i].load[0], core_id, runqueues[core_id].load[0]); - kprintf("Task on core %u: %u, core %u, %u\n", i, runqueues[i].nr_tasks, core_id, runqueues[i].nr_tasks); + //kprintf("Try to steal a task from core %u (load %u) to %u (load %u)\n", i, runqueues[i].load[0], core_id, runqueues[core_id].load[0]); + //kprintf("Task on core %u: %u, core %u, %u\n", i, runqueues[i].nr_tasks, core_id, runqueues[i].nr_tasks); prio = lsb(runqueues[i].prio_bitmap); if (prio < sizeof(size_t)*8) { // steal a ready task task = runqueues[i].queue[prio-1].last; - kprintf("Try to steal a ready task %d with prio %u\n", task->id, prio); + kprintf("Core %u steals the task %d form %u with prio %u\n", core_id, task->id, i, prio); // remove last element from queue i if (task->prev) @@ -1187,7 +1186,7 @@ void load_balancing(void) runqueues[core_id].nr_tasks++; runqueues[i].nr_tasks--; runqueues[core_id].balance_counter = TIMER_FREQ/2; - } else { + } /*else { task_t* tmp; // steal a blocked task @@ -1195,7 +1194,7 @@ void load_balancing(void) if (!task) // Ups, found no valid task to steal goto no_task_found; - kprintf("Try to steal blocked task %d\n", task->id); + kprintf("Core %u steals the blocked task %d from %u with prio %u\n", core_id, task->id, i, task->prio); // remove first timer from queue i if (runqueues[i].timers.first == runqueues[i].timers.last) @@ -1230,14 +1229,16 @@ void load_balancing(void) task->last_core = CORE_ID; // update task counters - runqueues[core_id].nr_tasks++; - runqueues[i].nr_tasks--; runqueues[core_id].balance_counter = TIMER_FREQ/2; - } + }*/ } -no_task_found: +//no_task_found: spinlock_irqsave_unlock(&runqueues[i].lock); } + + if (runqueues[core_id].balance_counter <= 0) + runqueues[core_id].balance_counter = TIMER_FREQ/2; + spinlock_irqsave_unlock(&runqueues[core_id].lock); #endif } @@ -1306,6 +1307,8 @@ void scheduler(void) prio = msb(runqueues[core_id].prio_bitmap); // determines highest priority #if MAX_CORES > 1 if (prio >= sizeof(size_t)*8) { + // push load balancing + runqueues[core_id].balance_counter -= TIMER_FREQ/20; load_balancing(); prio = msb(runqueues[core_id].prio_bitmap); // retry... } From c42642aadc1f078b260ad762a5462719734004fd Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Thu, 22 Sep 2011 21:36:05 +0200 Subject: [PATCH 08/11] remove typo --- arch/x86/include/asm/processor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index ad9e9f36..08f925c3 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -268,7 +268,7 @@ static inline void tlb_flush(void) static inline uint32_t read_eflags(void) { uint32_t result; - asm volatile ("pushf; pop $0" : "=r"(result)); + asm volatile ("pushf; pop %0" : "=r"(result)); return result; } From e9ddfd0db2c9e9ebccef5ac64d189cd3f8ea79e3 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Thu, 22 Sep 2011 21:36:29 +0200 Subject: [PATCH 09/11] dump current value of CR0 --- arch/x86/kernel/apic.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86/kernel/apic.c b/arch/x86/kernel/apic.c index da4c65f4..ca860d4f 100644 --- a/arch/x86/kernel/apic.c +++ b/arch/x86/kernel/apic.c @@ -320,6 +320,8 @@ void smp_start(uint32_t id) // enable additional cpu features cpu_detection(); + kprintf("CR0 of core %u: 0x%x\n", apic_cpu_id(), read_cr0()); + smp_main(); // idle loop @@ -355,6 +357,8 @@ int smp_init(void) if (ncores <= 1) return -EINVAL; + kprintf("CR0 of core %u: 0x%x\n", apic_cpu_id(), read_cr0()); + for(i=1; (i Date: Thu, 22 Sep 2011 21:37:57 +0200 Subject: [PATCH 10/11] remove obsolete debug messages --- arch/x86/kernel/timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/timer.c b/arch/x86/kernel/timer.c index a2d4ed9f..0ea49d0b 100644 --- a/arch/x86/kernel/timer.c +++ b/arch/x86/kernel/timer.c @@ -81,8 +81,8 @@ static void timer_handler(struct state *s) }*/ /* Dump load every minute */ - if (timer_ticks % (TIMER_FREQ*60) == 0) - dump_load(); + //if (timer_ticks % (TIMER_FREQ*60) == 0) + // dump_load(); } update_load(); From 89d487044f5b4a632b0f9e27cc73198b2f16fa3e Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Thu, 22 Sep 2011 21:38:25 +0200 Subject: [PATCH 11/11] switch back to the default examples --- kernel/tests.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/tests.c b/kernel/tests.c index 2bdd4d46..c01d806b 100644 --- a/kernel/tests.c +++ b/kernel/tests.c @@ -294,9 +294,9 @@ int test_init(void) //create_kernel_task(NULL, svm_test, NULL, NORMAL_PRIO); //create_user_task(NULL, "/bin/hello", argv); create_user_task(NULL, "/bin/tests", argv); - create_user_task(NULL, "/bin/jacobi", argv); + //create_user_task(NULL, "/bin/jacobi", argv); //create_user_task(NULL, "/bin/mshell", argv); - create_user_task(NULL, "/bin/jacobi", argv); + //create_user_task(NULL, "/bin/jacobi", argv); //create_user_task(NULL, "/bin/server", server_argv); //sleep(5); //create_user_task(NULL, "/bin/client", client_argv);