* vm_page: Swapped members usage_count and wired_count. We lost 4 bytes

due to alignment padding before.
* Reorganized merging of caches a bit. Renamed MergeStore() to Merge()
  and moved some more functionality into it. The method also moves the
  pages from source to consumer, now. This is necessary, since
  VMAnonymousCache needs to consider both physical pages and swap pages
  at the same time. Before we first moved the physical pages and the
  swap pages later, which was broken for two reasons: (1) A swap page in
  the consumer cache shadows a physical page of the source cache, which
  we ignored. (2) A source cache's physical page that also had a swap
  page would lose the latter in the process when moved to the consumer
  cache, i.e. if the page was not marked modified, it could be stolen
  and its data would be lost.

These changes improve the situation when building Haiku with 256 MB RAM
in that jam doesn't crash anymore, but in my test the system became
totally unusable after about an hour or 7000 targets (GUI froze). For
some reason it didn't manage to free pages anymore although swapping
heavily.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27179 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2008-08-23 19:01:01 +00:00
parent fa2fa606af
commit ed43619500
4 changed files with 177 additions and 63 deletions
+4 -2
View File
@@ -110,9 +110,11 @@ struct vm_page {
uint8 is_cleared : 1;
// is currently only used in vm_page_allocate_page_run()
uint8 busy_writing : 1;
uint8 merge_swap : 1;
// used in VMAnonymousCache::Merge()
uint16 wired_count;
int8 usage_count;
uint16 wired_count;
};
enum {
@@ -232,7 +234,7 @@ public:
virtual status_t Fault(struct vm_address_space *aspace, off_t offset);
virtual void MergeStore(VMCache* source);
virtual void Merge(VMCache* source);
virtual status_t AcquireUnreferencedStoreRef();
virtual void AcquireStoreRef();