mirror of
https://github.com/drasko/codezero.git
synced 2026-10-12 22:57:01 +02:00
Fixed a task suspend/resume scheduler issue.
- Scheduler was increasing total priorities only when resuming tasks had 0 ticks. This caused forked tasks that have parent's share of ticks to finish their jobs, if these tasks exited quick enough, they would cause the total priorities to deduce without increasing it in the first place. This is now fixed. - Also strengthened rq locking, now both queues are locked before touching any. - Also removed task suspends in irq, this would cause a race condition on ticks and runqueues, since neither is protected against irqs.
This commit is contained in:
+9
-1
@@ -75,8 +75,16 @@ void do_irq(void)
|
||||
}
|
||||
irq_enable(irq_index);
|
||||
|
||||
#if 0
|
||||
/* Process any pending flags for currently runnable task */
|
||||
task_process_pending_flags();
|
||||
if (!in_nested_irq_context()) {
|
||||
/* This is buggy, races on prio_total */
|
||||
if (in_user()) {
|
||||
if (current->flags & TASK_SUSPENDING)
|
||||
sched_suspend_async();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user