f7e414f22b
the same pages over and over. * Increased the priority of the page writer a bit, so that it is higher than the one of the page daemon. * Added a sModifiedTemporaryPages counter to let the page_writer decide how many pages are there to write back (temporary pages would go to the swap file and are only written back when memory is low). * In case there are more than 1024 modified (non-temporary) pages around, the page writer will constantly write out pages, not only when being pushed. * The page writer now temporarily always leave out temporary pages (as long as we don't have a swap file). * Shuffled functions around a bit. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22852 a95241bf-73f2-0310-859d-f6bbb57e9c96
31 lines
546 B
C++
31 lines
546 B
C++
/*
|
|
* Copyright 2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef PAGE_CACHE_LOCKER_H
|
|
#define PAGE_CACHE_LOCKER_H
|
|
|
|
|
|
#include <null.h>
|
|
|
|
struct vm_page;
|
|
|
|
|
|
class PageCacheLocker {
|
|
public:
|
|
PageCacheLocker(vm_page* page, bool dontWait = true);
|
|
~PageCacheLocker();
|
|
|
|
bool IsLocked() { return fPage != NULL; }
|
|
|
|
bool Lock(vm_page* page, bool dontWait = true);
|
|
void Unlock();
|
|
|
|
private:
|
|
bool _IgnorePage(vm_page* page);
|
|
|
|
vm_page* fPage;
|
|
};
|
|
|
|
#endif // PAGE_CACHE_LOCKER_H
|