Flushing pages to vfs will work, but the issue is that while vfs is

serving mm0, if it page faults, system deadlocks because mm0 is waiting to be served by vfs.

FIX: To fix this, mm0 will need to fork itself and keep a separate thread solely for
page fault handling.
This commit is contained in:
Bahadir Balban
2008-05-28 23:37:41 +03:00
parent 98888a94b5
commit f561d885d5
6 changed files with 39 additions and 9 deletions

View File

@@ -84,9 +84,15 @@ int file_page_out(struct vm_object *vm_obj, unsigned long page_offset)
if (!(page->flags & VM_DIRTY))
return 0;
paddr = (void *)page_to_phys(page);
vaddr = phys_to_virt(paddr);
/* Map the page to vfs task */
l4_map(paddr, vaddr, 1, MAP_USR_RW_FLAGS, VFS_TID);
printf("%s/%s: Writing to vnode %d, at pgoff 0x%x, %d pages, buf at 0x%x\n",
__TASKNAME__, __FUNCTION__, vm_file_to_vnum(f), page_offset, 1, vaddr);
/* Syscall to vfs to write page back to file. */
if ((err = vfs_write(vm_file_to_vnum(f), page_offset, 1, vaddr)) < 0)
goto out_err;