[haiku-bugs] Re: [Haiku] #8466: VM caches aren't resized in some cases when cutting areas

  • From: "hamish" <trac@xxxxxxxxxxxx>
  • Date: Fri, 13 Apr 2012 14:43:13 -0000

#8466: VM caches aren't resized in some cases when cutting areas
-----------------------------+-----------------------------
   Reporter:  hamish         |      Owner:  bonefish
       Type:  bug            |     Status:  assigned
   Priority:  normal         |  Milestone:  R1
  Component:  System/Kernel  |    Version:  R1/Development
 Resolution:                 |   Keywords:  kernel vm cache
 Blocked By:                 |   Blocking:
Has a Patch:  0              |   Platform:  All
-----------------------------+-----------------------------

Comment (by hamish):

 Here's what I'm thinking of doing:

 To handle the cut-start-of-area case, add a `VMCache::Rebase()` method as
 a counterpart to `VMCache::Resize()` which will move the virtual base of
 cache and free any pages no longer contained in the region.

 To handle the cut-middle-of-area case, add a `VMCache::MovePageRange(off_t
 offset, off_t size, VMCache* destination, off_t destinationOffset)`
 method. Then create a new cache for the second area and move the pages
 there. I realise this is inconsistent with the other page moving methods
 because they are called on the destination cache, but it would be nice to
 iterate the page tree directly instead of calling `LookupPage()`
 repeatedly on the source cache.

 Does this sound OK?

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/8466#comment:2>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: