Kernel: Memory purging improvements

This adds the ability for a Region to define volatile/nonvolatile
areas within mapped memory using madvise(). This also means that
memory purging takes into account all views of the PurgeableVMObject
and only purges memory that is not needed by all of them. When calling
madvise() to change an area to nonvolatile memory, return whether
memory from that area was purged. At that time also try to remap
all memory that is requested to be nonvolatile, and if insufficient
pages are available notify the caller of that fact.
This commit is contained in:
Tom 2020-09-02 22:57:09 -06:00 committed by Andreas Kling
commit bc5d6992a4
Notes: sideshowbarker 2024-07-19 00:14:45 +09:00
14 changed files with 655 additions and 62 deletions

View file

@ -331,7 +331,7 @@ static OwnPtr<KBuffer> procfs$pid_vm(InodeIdentifier identifier)
region_object.add("user_accessible", region.is_user_accessible());
region_object.add("purgeable", region.vmobject().is_purgeable());
if (region.vmobject().is_purgeable()) {
region_object.add("volatile", static_cast<const PurgeableVMObject&>(region.vmobject()).is_volatile());
region_object.add("volatile", static_cast<const PurgeableVMObject&>(region.vmobject()).is_any_volatile());
}
region_object.add("cacheable", region.is_cacheable());
region_object.add("kernel", region.is_kernel());