page writer:
* When writing a page failed it is not a good idea to re-enqueue it at the tail of the modified queue, since that is definitely behind the page writer's marker and the page would be picked up again before reaching the end of the queue. If that happened with more than 256 pages, the page writer would keep picking up only those non-writable pages and make no more progress. * When selecting pages also skip temporary pages, if there's no more swap space available, since trying to write those pages would most likely fail anyway (triggering the first problem). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30230 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
#include <vm_page.h>
|
||||
#include <vm_cache.h>
|
||||
|
||||
#include "VMAnonymousCache.h"
|
||||
#include "IORequest.h"
|
||||
#include "PageCacheLocker.h"
|
||||
|
||||
@@ -1120,7 +1121,9 @@ PageWriterRun::Go()
|
||||
{
|
||||
InterruptsSpinLocker locker(sPageLock);
|
||||
page->state = PAGE_STATE_MODIFIED;
|
||||
enqueue_page(&sModifiedPageQueue, page);
|
||||
enqueue_page_to_head(&sModifiedPageQueue, page);
|
||||
// Enqueue to the head, so we don't put it behind the
|
||||
// page writer's marker again.
|
||||
}
|
||||
|
||||
if (!page->busy_writing) {
|
||||
@@ -1243,7 +1246,8 @@ page_writer(void* /*unused*/)
|
||||
if (page->wired_count > 0
|
||||
|| (cache->temporary
|
||||
#if ENABLE_SWAP_SUPPORT
|
||||
&& (!lowOnPages /*|| page->usage_count > 0*/)
|
||||
&& (!lowOnPages /*|| page->usage_count > 0*/
|
||||
|| swap_available_pages() == 0)
|
||||
#endif
|
||||
)) {
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user