diff --git a/kernel/kernel/kernel.c b/kernel/kernel/kernel.c index 4579ef94b..80cb750fb 100644 --- a/kernel/kernel/kernel.c +++ b/kernel/kernel/kernel.c @@ -115,12 +115,6 @@ static void _kernel_bootstrap_part2(void) { // TODO(PT): Only mask the PIT once we're sure all cores have calibrated // TODO(PT): Pull the PIT IRQ line somehow - /* - uint32_t start = ms_since_boot(); - printf("BSP spinlooping...\n"); - while (ms_since_boot() < start + 3000) {} - printf("BSP will mask PIT.\n"); - */ smp_core_continue(); } diff --git a/kernel/kernel/multitasking/tasks/mlfq.c b/kernel/kernel/multitasking/tasks/mlfq.c index fc0e161e0..ac48d3230 100644 --- a/kernel/kernel/multitasking/tasks/mlfq.c +++ b/kernel/kernel/multitasking/tasks/mlfq.c @@ -55,7 +55,7 @@ bool mlfq_choose_task(task_small_t** out_task, uint32_t* out_quantum) { mlfq_queue_t* q = array_m_lookup(_queues, i); for (int j = 0; j < q->round_robin_tasks->size; j++) { mlfq_ent_t* ent = array_l_lookup(q->round_robin_tasks, j); - if (ent->task->blocked_info.status == RUNNABLE && ent->task->cpu_id == cpu_id()) { + if (ent->task->blocked_info.status == RUNNABLE && !ent->task->is_currently_executing /*&& ent->task->cpu_id == cpu_id()*/) { *out_task = ent->task; *out_quantum = ent->ttl_remaining; ent->last_schedule_start = ms_since_boot(); @@ -225,7 +225,7 @@ void mlfq_print(void) { blocked_reason = "unknown"; break; } - printf("[%d %s %s] ", ent->task->id, ent->task->name, blocked_reason); + printf("[[Cpu%d,Pid%d] %s %s] ", ent->task->cpu_id, ent->task->id, ent->task->name, blocked_reason); } printf("\n"); } diff --git a/kernel/kernel/multitasking/tasks/task_small.h b/kernel/kernel/multitasking/tasks/task_small.h index 369110b5b..3509fa2d3 100644 --- a/kernel/kernel/multitasking/tasks/task_small.h +++ b/kernel/kernel/multitasking/tasks/task_small.h @@ -81,6 +81,7 @@ typedef struct task_small { char* managing_parent_service_name; uintptr_t cpu_id; + bool is_currently_executing; } task_small_t; void tasking_init_small();