Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#228 closed defect (fixed)

CPU lock taken when interrupts are enabled

Reported by: Jakub Jermář Owned by:
Priority: major Milestone: 0.4.3
Component: helenos/kernel/generic Version: mainline
Keywords: Cc:
Blocker for: Depends on:
See also:

Description (last modified by Martin Decky)

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)

comment:1 by Jakub Jermář, 14 years ago

Resolution: fixed
Status: newclosed

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.

comment:2 by Martin Decky, 14 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.