Fork us on GitHub Follow us on Facebook Follow us on Twitter

Opened 9 years ago

Closed 9 years ago

Last modified 9 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 Changed 9 years ago by Jakub Jermář

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 Changed 9 years ago by Martin Decky

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