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

@@ -46,18 +46,15 @@ int default_release_pages(struct vm_object *vm_obj)
struct page *p, *n;
list_for_each_entry_safe(p, n, &vm_obj->page_cache, list) {
list_del(&p->list);
list_del_init(&p->list);
BUG_ON(p->refcnt);
/* Reinitialise the page */
page_init(p);
/* Return page back to allocator */
free_page((void *)page_to_phys(p));
/*
* Reset the page structure.
* No freeing for page_array pages
*/
memset(p, 0, sizeof(*p));
/* Reduce object page count */
BUG_ON(--vm_obj->npages < 0);
}
@@ -103,7 +100,7 @@ int file_page_out(struct vm_object *vm_obj, unsigned long page_offset)
/* Unmap it from vfs */
l4_unmap(vaddr, 1, VFS_TID);
/* Update page details */
/* Clear dirty flag */
page->flags &= ~VM_DIRTY;
return 0;