ladybird/Kernel/VM
Andreas Kling c624d3875e Kernel: Use a shared physical page for zero-filled pages until written
This patch adds a globally shared zero-filled PhysicalPage that will
be mapped into every slot of every zero-filled AnonymousVMObject until
that page is written to, achieving CoW-like zero-filled pages.

Initial testing show that this doesn't actually achieve any sharing yet
but it seems like a good design regardless, since it may reduce the
number of page faults taken by programs.

If you look at the refcount of MM.shared_zero_page() it will have quite
a high refcount, but that's just because everything maps it everywhere.
If you want to see the "real" refcount, you can build with the
MAP_SHARED_ZERO_PAGE_LAZILY flag, and we'll defer mapping of the shared
zero page until the first NP read fault.

I've left this behavior behind a flag for future testing of this code.
2020-02-15 13:17:40 +01:00
..
AnonymousVMObject.cpp Kernel: Use a shared physical page for zero-filled pages until written 2020-02-15 13:17:40 +01:00
AnonymousVMObject.h Kernel: Use VirtualAddress & PhysicalAddress classes from LibBareMetal 2020-02-09 19:38:17 +01:00
InodeVMObject.cpp Kernel: Enforce W^X between sys$mmap() and sys$execve() 2020-01-18 23:40:12 +01:00
InodeVMObject.h Kernel: Enforce W^X between sys$mmap() and sys$execve() 2020-01-18 23:40:12 +01:00
MemoryManager.cpp Kernel: Use a shared physical page for zero-filled pages until written 2020-02-15 13:17:40 +01:00
MemoryManager.h Kernel: Use a shared physical page for zero-filled pages until written 2020-02-15 13:17:40 +01:00
PageDirectory.cpp Use uintptr_t instead of u32 when storing pointers as integers 2020-01-20 13:13:03 +01:00
PageDirectory.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
PhysicalPage.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
PhysicalPage.h Kernel: Use a shared physical page for zero-filled pages until written 2020-02-15 13:17:40 +01:00
PhysicalRegion.cpp Use uintptr_t instead of u32 when storing pointers as integers 2020-01-20 13:13:03 +01:00
PhysicalRegion.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
PurgeableVMObject.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
PurgeableVMObject.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
RangeAllocator.cpp Kernel: Remove more <LibBareMetal/Output/kstdio.h> includes 2020-02-10 12:07:48 +01:00
RangeAllocator.h Kernel: Use VirtualAddress & PhysicalAddress classes from LibBareMetal 2020-02-09 19:38:17 +01:00
Region.cpp Kernel: Use a shared physical page for zero-filled pages until written 2020-02-15 13:17:40 +01:00
Region.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
VMObject.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
VMObject.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00