schedule(): hold runq lock for the entire duration of context switching

releasing the runq lock after loading page tables but before the actual
context switch can leave execution in an inconsistent if the current
process is descheduled from an IRQ between these two steps.
this patch holds the runq lock with IRQs disabled and makes the context
switch a single atomic operation.
This commit is contained in:
Balazs Gerofi
2015-08-10 12:37:12 +09:00
parent 8d6c97ea5c
commit 9ba40dc0ff
4 changed files with 34 additions and 5 deletions

View File

@@ -46,6 +46,7 @@ struct cpu_local_var {
struct process_vm idle_vm;
ihk_spinlock_t runq_lock;
unsigned long runq_irqstate;
struct process *current;
struct list_head runq;
size_t runq_len;