* Removed the page state PAGE_STATE_BUSY and instead introduced a vm_page::busy

flag. The obvious advantage is that one can still see what state a page is in
  and even move it between states while being marked busy.
* Removed the vm_page::is_dummy flag. Instead we mark marker pages busy, which
  in all cases has the same effect. Introduced a vm_page_is_dummy() that can
  still check whether a given page is a dummy page.
* vm_page_unreserve_pages(): Before adding to the system reserve make sure
  sUnreservedFreePages is non-negative. Otherwise we'd make nonexisting pages
  available for allocation. steal_pages() still has the same problem and it
  can't be solved that easily.
* map_page(): No longer changes the page state/mark the page unbusy. That's the
  caller's responsibility.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35331 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2010-01-29 10:00:45 +00:00
parent 1196f305d7
commit 72382fa629
12 changed files with 126 additions and 86 deletions
+9
View File
@@ -90,6 +90,7 @@ public:
void NotifyPageEvents(vm_page* page, uint32 events)
{ if (fPageEventWaiters != NULL)
_NotifyPageEvents(page, events); }
inline void MarkPageUnbusy(vm_page* page);
vm_page* LookupPage(off_t offset);
void InsertPage(vm_page* page, off_t offset);
@@ -291,6 +292,14 @@ VMCache::ReleaseRefAndUnlock(bool consumerLocked)
}
void
VMCache::MarkPageUnbusy(vm_page* page)
{
page->busy = false;
NotifyPageEvents(page, PAGE_EVENT_NOT_BUSY);
}
#ifdef __cplusplus
extern "C" {
#endif
+1
View File
@@ -56,6 +56,7 @@ struct vm_page *vm_page_allocate_page_run_no_base(int state, addr_t count,
int priority);
struct vm_page *vm_page_at_index(int32 index);
struct vm_page *vm_lookup_page(addr_t pageNumber);
bool vm_page_is_dummy(struct vm_page *page);
#ifdef __cplusplus
}
+1 -3
View File
@@ -106,7 +106,7 @@ public:
#endif
uint8 state : 3;
bool is_dummy : 1;
bool busy : 1;
bool busy_writing : 1;
// used in VMAnonymousCache::Merge()
bool accessed : 1;
@@ -116,7 +116,6 @@ public:
int8 usage_count;
uint16 wired_count;
VMCacheRef* CacheRef() const { return cache_ref; }
void SetCacheRef(VMCacheRef* cacheRef) { this->cache_ref = cacheRef; }
@@ -128,7 +127,6 @@ public:
enum {
PAGE_STATE_ACTIVE = 0,
PAGE_STATE_INACTIVE,
PAGE_STATE_BUSY,
PAGE_STATE_MODIFIED,
PAGE_STATE_FREE,
PAGE_STATE_CLEAR,