[haiku-commits] haiku: hrev43473 - src/system/kernel/vm

  • From: mmlr@xxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 11 Dec 2011 17:08:21 +0100 (CET)

hrev43473 adds 2 changesets to branch 'master'
old head: 0a1ac2bfd8e3e66ddd39982a997174245638348e
new head: 6ef7d359c7b8dc970e0dbc7d7e2baa67f00d3695

----------------------------------------------------------------------------

af09f12: Create the right cache type ([non-]swappable) on copy on write.
  
  When forking a team, copy on write areas (and therefore caches) are
  created for all the areas in the parent team, but they were always
  created as swappable. If the parent team had some B_FULL_LOCK areas,
  which aren't swappable, the wrong type of cache would be created which
  lead to them not being mergeable later on (causing a panic).
  
  Comments about a possibly cleaner way to figure out the cache type
  would be welcome.

6ef7d35: ASSERT() that there really aren't any wired pages.

                                            [ Michael Lotz <mmlr@xxxxxxxx> ]

----------------------------------------------------------------------------

1 files changed, 5 insertions(+), 1 deletions(-)
src/system/kernel/vm/vm.cpp |    6 +++++-

############################################################################

Commit:      af09f123d3df57e2fd9fef9ac9edbfe55c61a431
URL:         http://cgit.haiku-os.org/haiku/commit/?id=af09f12
Author:      Michael Lotz <mmlr@xxxxxxxx>
Date:        Sun Dec 11 15:54:13 2011 UTC

Create the right cache type ([non-]swappable) on copy on write.

When forking a team, copy on write areas (and therefore caches) are
created for all the areas in the parent team, but they were always
created as swappable. If the parent team had some B_FULL_LOCK areas,
which aren't swappable, the wrong type of cache would be created which
lead to them not being mergeable later on (causing a panic).

Comments about a possibly cleaner way to figure out the cache type
would be welcome.

----------------------------------------------------------------------------

diff --git a/src/system/kernel/vm/vm.cpp b/src/system/kernel/vm/vm.cpp
index 75bbc80..a03d690 100644
--- a/src/system/kernel/vm/vm.cpp
+++ b/src/system/kernel/vm/vm.cpp
@@ -55,6 +55,7 @@
 
 #include "VMAddressSpaceLocking.h"
 #include "VMAnonymousCache.h"
+#include "VMAnonymousNoSwapCache.h"
 #include "IORequest.h"
 
 
@@ -2300,7 +2301,8 @@ vm_copy_on_write_area(VMCache* lowerCache,
 
        // create an anonymous cache
        status_t status = VMCacheFactory::CreateAnonymousCache(upperCache, 
false, 0,
-               0, true, VM_PRIORITY_USER);
+               0, dynamic_cast<VMAnonymousNoSwapCache*>(lowerCache) == NULL,
+               VM_PRIORITY_USER);
        if (status != B_OK)
                return status;
 

############################################################################

Revision:    hrev43473
Commit:      6ef7d359c7b8dc970e0dbc7d7e2baa67f00d3695
URL:         http://cgit.haiku-os.org/haiku/commit/?id=6ef7d35
Author:      Michael Lotz <mmlr@xxxxxxxx>
Date:        Sun Dec 11 16:00:23 2011 UTC

ASSERT() that there really aren't any wired pages.

----------------------------------------------------------------------------

diff --git a/src/system/kernel/vm/vm.cpp b/src/system/kernel/vm/vm.cpp
index a03d690..c6d6829 100644
--- a/src/system/kernel/vm/vm.cpp
+++ b/src/system/kernel/vm/vm.cpp
@@ -2363,6 +2363,8 @@ vm_copy_on_write_area(VMCache* lowerCache,
                        }
                }
        } else {
+               ASSERT(lowerCache->WiredPagesCount() == 0);
+
                // just change the protection of all areas
                for (VMArea* tempArea = upperCache->areas; tempArea != NULL;
                                tempArea = tempArea->cache_next) {


Other related posts:

  • » [haiku-commits] haiku: hrev43473 - src/system/kernel/vm - mmlr