if a task exists with a higher priority, we start a rescheduling in check_workqueues.
This commit is contained in:
parent
41dc03235a
commit
27e652f81d
5 changed files with 12 additions and 14 deletions
|
@ -132,7 +132,7 @@ int svm_access_request(size_t addr)
|
|||
icc_mail_check(0);
|
||||
|
||||
while (page_owner[pageid] != my_ue) {
|
||||
check_workqueues_rem_irq();
|
||||
check_workqueues();
|
||||
}
|
||||
|
||||
return change_page_permissions(addr, addr+PAGE_SIZE, VMA_READ|VMA_WRITE|VMA_CACHEABLE);
|
||||
|
|
|
@ -176,12 +176,9 @@ size_t get_idle_task(uint32_t id);
|
|||
*/
|
||||
int sys_execve(const char* fname, char** argv, char** env);
|
||||
|
||||
/** @brief determines the highest priority of all ready tasks on core core_id
|
||||
*
|
||||
* @param core_id core id
|
||||
* @return highest priority
|
||||
/** @brief if a task exists with higher priority, MetalSVM switch to it.
|
||||
*/
|
||||
uint32_t get_highest_priority(uint32_t core_id);
|
||||
void check_scheduling(void);
|
||||
|
||||
/** @brief Call to rescheduling
|
||||
*
|
||||
|
@ -194,6 +191,7 @@ static inline void check_workqueues(void)
|
|||
#ifdef CONFIG_ROCKCREEK
|
||||
icc_mail_check(0);
|
||||
#endif
|
||||
check_scheduling();
|
||||
}
|
||||
|
||||
static inline void check_workqueues_rem_irq(void)
|
||||
|
|
|
@ -94,12 +94,9 @@ int main(void)
|
|||
create_kernel_task(NULL, initd, NULL, NORMAL_PRIO);
|
||||
reschedule();
|
||||
|
||||
while(1) {
|
||||
#ifdef CONFIG_ROCKCREEK
|
||||
//icc_halt();
|
||||
#else
|
||||
while(1) {
|
||||
check_workqueues();
|
||||
HALT;
|
||||
#endif
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -91,7 +91,7 @@ int syscall_handler(uint32_t sys_nr, ...)
|
|||
int ret = -EINVAL;
|
||||
va_list vl;
|
||||
|
||||
check_workqueues_rem_irq();
|
||||
check_workqueues();
|
||||
|
||||
va_start(vl, sys_nr);
|
||||
|
||||
|
|
|
@ -68,8 +68,11 @@ task_t* get_current_task(void) {
|
|||
return per_core(current_task);
|
||||
}
|
||||
|
||||
uint32_t get_highest_priority(uint32_t core_id) {
|
||||
return msb(runqueues[core_id].prio_bitmap);
|
||||
void check_scheduling(void) {
|
||||
if (!is_irq_enabled())
|
||||
return;
|
||||
if (msb(runqueues[CORE_ID].prio_bitmap) > per_core(current_task)->prio)
|
||||
reschedule();
|
||||
}
|
||||
|
||||
int multitasking_init(void) {
|
||||
|
|
Loading…
Add table
Reference in a new issue