CPU lock taken when interrupts are enabled
In changeset:mainline,378, the following change, which introduces a potential deadlock between the scheduler and the interrupt code, was made:
=== modified file 'kernel/generic/src/proc/scheduler.c'
--- kernel/generic/src/proc/scheduler.c 2010-02-22 21:24:19 +0000
+++ kernel/generic/src/proc/scheduler.c 2010-04-06 11:53:32 +0000
@@ -201,6 +201,9 @@
* even though there is a runnable thread.
*/
+ spinlock_lock(&CPU->lock);
+ CPU->idle = true;
+ spinlock_unlock(&CPU->lock);
cpu_sleep();
goto loop;
}
Change History
(2)
Resolution: |
→ fixed
|
Status: |
new → closed
|
Description: |
modified (diff)
|
Fixed in changeset:head,407.
However I am still not convinced we need to update CPU→idle under any lock - a mere atomic set should suffice.