uti: Fix uti thread on the McKernel side blocks others in do_syscall()
It could block other threads on the same CPU in do_syscall() since it busy-waits after woken up because it's not allowed to sleep again.
This commit is contained in:
@@ -320,11 +320,11 @@ long do_syscall(struct syscall_request *req, int cpu, int pid)
|
|||||||
flags = cpu_disable_interrupt_save();
|
flags = cpu_disable_interrupt_save();
|
||||||
|
|
||||||
/* Try to sleep until notified */
|
/* Try to sleep until notified */
|
||||||
if (__sync_bool_compare_and_swap(&res.req_thread_status,
|
if (res.req_thread_status == IHK_SCD_REQ_THREAD_DESCHEDULED ||
|
||||||
IHK_SCD_REQ_THREAD_SPINNING,
|
__sync_bool_compare_and_swap(&res.req_thread_status,
|
||||||
IHK_SCD_REQ_THREAD_DESCHEDULED)) {
|
IHK_SCD_REQ_THREAD_SPINNING,
|
||||||
|
IHK_SCD_REQ_THREAD_DESCHEDULED)) {
|
||||||
dkprintf("%s: tid %d waiting for syscall reply...\n",
|
kprintf("%s: tid %d waiting for syscall reply...\n",
|
||||||
__FUNCTION__, thread->tid);
|
__FUNCTION__, thread->tid);
|
||||||
waitq_init(&thread->scd_wq);
|
waitq_init(&thread->scd_wq);
|
||||||
waitq_prepare_to_wait(&thread->scd_wq, &scd_wq_entry,
|
waitq_prepare_to_wait(&thread->scd_wq, &scd_wq_entry,
|
||||||
|
|||||||
Reference in New Issue
Block a user