summaryrefslogtreecommitdiff
path: root/Kernel/VM/Region.h
diff options
context:
space:
mode:
authorTom <tomut@yahoo.com>2020-09-04 21:12:25 -0600
committerAndreas Kling <kling@serenityos.org>2021-01-01 23:43:44 +0100
commitb2a52f62089e4799336cf0bf32eb307b077d2e72 (patch)
treed0e3763a1a452357c76b5fe68fa3ab1b6bc83147 /Kernel/VM/Region.h
parente21cc4cff63c36917d83730871dfff1a9f0eb927 (diff)
downloadserenity-b2a52f62089e4799336cf0bf32eb307b077d2e72.zip
Kernel: Implement lazy committed page allocation
By designating a committed page pool we can guarantee to have physical pages available for lazy allocation in mappings. However, when forking we will overcommit. The assumption is that worst-case it's better for the fork to die due to insufficient physical memory on COW access than the parent that created the region. If a fork wants to ensure that all memory is available (trigger a commit) then it can use madvise. This also means that fork now can gracefully fail if we don't have enough physical pages available.
Diffstat (limited to 'Kernel/VM/Region.h')
-rw-r--r--Kernel/VM/Region.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/VM/Region.h b/Kernel/VM/Region.h
index e1ec47a6bc..5abf9217f2 100644
--- a/Kernel/VM/Region.h
+++ b/Kernel/VM/Region.h
@@ -105,7 +105,7 @@ public:
PageFaultResponse handle_fault(const PageFault&);
- NonnullOwnPtr<Region> clone();
+ OwnPtr<Region> clone();
bool contains(VirtualAddress vaddr) const
{
@@ -194,7 +194,7 @@ public:
void set_inherit_mode(InheritMode inherit_mode) { m_inherit_mode = inherit_mode; }
- bool remap_page_range(size_t page_index, size_t page_count, bool do_commit);
+ bool remap_page_range(size_t page_index, size_t page_count);
bool is_volatile(VirtualAddress vaddr, size_t size) const;
enum class SetVolatileError {