From d277d9f2f8d75b9f4fd761bb73c7670770fae6b9 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Fri, 29 Aug 2008 00:49:09 +0000 Subject: [PATCH] Don't always commit memory in VMAnonymousCache::Fault() for overcommitting caches. If the page in question was just not mapped or swapped out, we would increase the committment unnecessarily (potentially even beyond the size of the cache). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27229 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/vm/VMAnonymousCache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system/kernel/vm/VMAnonymousCache.cpp b/src/system/kernel/vm/VMAnonymousCache.cpp index 302884cc38..a0fd8bb4fd 100644 --- a/src/system/kernel/vm/VMAnonymousCache.cpp +++ b/src/system/kernel/vm/VMAnonymousCache.cpp @@ -697,7 +697,7 @@ VMAnonymousCache::WriteAsync(off_t offset, const iovec* vecs, size_t count, status_t VMAnonymousCache::Fault(struct vm_address_space *aspace, off_t offset) { - if (fCanOvercommit) { + if (fCanOvercommit && LookupPage(offset) == NULL && !HasPage(offset)) { if (fGuardedSize > 0) { uint32 guardOffset;