Make cpu->proc_run_q_count not atomic
This commit is contained in:
@@ -198,7 +198,7 @@ void proc_register (struct proc* proc, struct cpu* register_cpu, struct reschedu
|
||||
|
||||
rbtree_insert (struct proc, &proc_tree, &proc->proc_tree_link, proc_tree_link, pid);
|
||||
|
||||
atomic_fetch_add (&cpu->proc_run_q_count, 1);
|
||||
cpu->proc_run_q_count++;
|
||||
list_append (cpu->proc_run_q, &proc->cpu_run_q_link);
|
||||
if (cpu->proc_current == NULL)
|
||||
cpu->proc_current = proc;
|
||||
@@ -315,7 +315,7 @@ void proc_kill (struct proc* proc, struct reschedule_ctx* rctx) {
|
||||
proc->cpu = NULL;
|
||||
|
||||
list_remove (cpu->proc_run_q, &proc->cpu_run_q_link);
|
||||
atomic_fetch_sub (&cpu->proc_run_q_count, 1);
|
||||
cpu->proc_run_q_count--;
|
||||
if (cpu->proc_current == proc)
|
||||
cpu->proc_current = NULL;
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ void proc_sq_suspend (struct proc* proc, struct proc_suspension_q* sq, spin_lock
|
||||
list_append (proc->sq_entries, &sq_entry->proc_link);
|
||||
|
||||
list_remove (cpu->proc_run_q, &proc->cpu_run_q_link);
|
||||
atomic_fetch_sub (&cpu->proc_run_q_count, 1);
|
||||
cpu->proc_run_q_count--;
|
||||
|
||||
if (cpu->proc_current == proc)
|
||||
cpu->proc_current = NULL;
|
||||
@@ -73,7 +73,7 @@ void proc_sq_resume (struct proc* proc, struct proc_sq_entry* sq_entry,
|
||||
atomic_store (&proc->state, PROC_READY);
|
||||
|
||||
list_append (cpu->proc_run_q, &proc->cpu_run_q_link);
|
||||
atomic_fetch_add (&cpu->proc_run_q_count, 1);
|
||||
cpu->proc_run_q_count++;
|
||||
|
||||
spin_unlock (&sq->lock);
|
||||
spin_unlock (&proc->lock);
|
||||
|
||||
Reference in New Issue
Block a user