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