mirror of
https://github.com/drasko/codezero.git
synced 2026-01-16 04:43:16 +01: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:
@@ -75,6 +75,11 @@ static inline void irq_local_disable()
|
||||
/* This is filled on entry to irq handler, only if a process was interrupted.*/
|
||||
extern unsigned int preempted_psr;
|
||||
|
||||
/*
|
||||
* FIXME: TASK_IN_KERNEL works for non-current tasks, in_kernel() works for current task?
|
||||
* in_kernel() is for irq, since normally in process context you know if you are in kernel or not :-)
|
||||
*/
|
||||
|
||||
/* Implementing these as functions cause circular include dependency for tcb.h */
|
||||
#define TASK_IN_KERNEL(tcb) (((tcb)->context.spsr & ARM_MODE_MASK) == ARM_MODE_SVC)
|
||||
#define TASK_IN_USER(tcb) (!TASK_IN_KERNEL(tcb))
|
||||
|
||||
@@ -148,7 +148,5 @@ extern struct id_pool *thread_id_pool;
|
||||
extern struct id_pool *space_id_pool;
|
||||
extern struct id_pool *tgroup_id_pool;
|
||||
|
||||
void task_process_pending_flags(void);
|
||||
|
||||
#endif /* __TCB_H__ */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user