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:
Bahadir Balban
2008-10-13 12:22:10 +03:00
parent f6d0a79298
commit 0db0f7e334
23 changed files with 416 additions and 200 deletions

View File

@@ -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);