* I just saw the page writer passing a free page to write_page().

Apparently not everyone checks the page state for PAGE_STATE_BUSY.
  vm_page_write_modified_pages() does now at least.
* Fixed typos in comments.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22349 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2007-09-28 18:48:09 +00:00
parent a6778735f9
commit cfed176e68
+5 -3
View File
@@ -680,7 +680,7 @@ page_writer(void* /*unused*/)
vm_page *pages[kNumPages]; vm_page *pages[kNumPages];
uint32 numPages = 0; uint32 numPages = 0;
// TODO: once the I/O scheduler is there, we should write back // TODO: once the I/O scheduler is there, we should write
// a lot more pages back. // a lot more pages back.
// TODO: make this laptop friendly, too (ie. only start doing // TODO: make this laptop friendly, too (ie. only start doing
// something if someone else did something or there is really // something if someone else did something or there is really
@@ -730,7 +730,7 @@ page_writer(void* /*unused*/)
writeStatus[i] = write_page(pages[i], false); writeStatus[i] = write_page(pages[i], false);
} }
// mark pages depending on if they could be written or not // mark pages depending on whether they could be written or not
for (uint32 i = 0; i < numPages; i++) { for (uint32 i = 0; i < numPages; i++) {
vm_cache *cache = pages[i]->cache; vm_cache *cache = pages[i]->cache;
@@ -854,8 +854,10 @@ vm_page_write_modified_pages(vm_cache *cache, bool fsReenter)
InterruptsSpinLocker locker(&sPageLock); InterruptsSpinLocker locker(&sPageLock);
remove_page_from_queue(&sModifiedPageQueue, page); remove_page_from_queue(&sModifiedPageQueue, page);
dequeuedPage = true; dequeuedPage = true;
} else if (!vm_test_map_modification(page)) } else if (page->state == PAGE_STATE_BUSY
|| !vm_test_map_modification(page)) {
continue; continue;
}
page->state = PAGE_STATE_BUSY; page->state = PAGE_STATE_BUSY;