mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:47:36 +00:00
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.
This commit is contained in:
parent
e21cc4cff6
commit
b2a52f6208
20 changed files with 329 additions and 67 deletions
|
@ -38,10 +38,12 @@ public:
|
|||
static NonnullRefPtr<AnonymousVMObject> create_with_size(size_t);
|
||||
static RefPtr<AnonymousVMObject> create_for_physical_range(PhysicalAddress, size_t);
|
||||
static NonnullRefPtr<AnonymousVMObject> create_with_physical_page(PhysicalPage&);
|
||||
virtual NonnullRefPtr<VMObject> clone() override;
|
||||
virtual RefPtr<VMObject> clone() override;
|
||||
|
||||
virtual RefPtr<PhysicalPage> allocate_committed_page(size_t);
|
||||
|
||||
protected:
|
||||
explicit AnonymousVMObject(size_t);
|
||||
explicit AnonymousVMObject(size_t, bool initialize_pages = true);
|
||||
explicit AnonymousVMObject(const AnonymousVMObject&);
|
||||
|
||||
virtual const char* class_name() const override { return "AnonymousVMObject"; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue