mirror of
https://github.com/drasko/codezero.git
synced 2026-01-16 12:53:16 +01:00
Multiple updates on sleeping, vma dropping and thread suspend.
- Updated sleeping paths such that a task is atomically put into a runqueue and made RUNNABLE, or removed from a runqueue and made SLEEPING. - Modified vma dropping sources to handle both copy_on_write() and exit() cases in a common function. - Added the first infrastructure to have a pager to suspend a task and wait for suspend completion from the scheduler.
This commit is contained in:
@@ -82,6 +82,7 @@ int ipc_send(l4id_t recv_tid)
|
||||
/* Remove from waitqueue */
|
||||
list_del_init(&wq->task_list);
|
||||
wqhr->sleepers--;
|
||||
task_unset_wqh(receiver);
|
||||
|
||||
/* Release locks */
|
||||
spin_unlock(&wqhr->slock);
|
||||
@@ -103,7 +104,7 @@ int ipc_send(l4id_t recv_tid)
|
||||
wqhs->sleepers++;
|
||||
list_add_tail(&wq.task_list, &wqhs->task_list);
|
||||
task_set_wqh(current, wqhs, &wq);
|
||||
current->state = TASK_SLEEPING;
|
||||
sched_prepare_sleep();
|
||||
spin_unlock(&wqhr->slock);
|
||||
spin_unlock(&wqhs->slock);
|
||||
// printk("%s: (%d) waiting for (%d)\n", __FUNCTION__,
|
||||
@@ -168,7 +169,7 @@ int ipc_recv(l4id_t senderid)
|
||||
wqhr->sleepers++;
|
||||
list_add_tail(&wq.task_list, &wqhr->task_list);
|
||||
task_set_wqh(current, wqhr, &wq);
|
||||
current->state = TASK_SLEEPING;
|
||||
sched_prepare_sleep();
|
||||
// printk("%s: (%d) waiting for (%d)\n", __FUNCTION__,
|
||||
// current->tid, current->expected_sender);
|
||||
spin_unlock(&wqhr->slock);
|
||||
|
||||
Reference in New Issue
Block a user