mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-14 19:06:55 +02:00
After a fork(), page faults on anonymous mmaps can cause a redundant page fault to occur. This happens because VMObjects for anonymous mmaps are initially filled with references to the lazy_committed_page or shared_zero_page. If there is a fork, VMObject::try_clone() is called and all pages of the VMObject are marked as cow (via the m_cow_map). Page faults on a zero/lazy page are handled by handle_zero_fault(). handle_zero_fault() does not update m_cow_map, so if the page was marked cow before the fault, it will still be marked cow after the fault. This causes a second (redundant) page fault when the CPU retries the write. This commit removes the redundant page fault by not marking zero/lazy pages as cow in m_cow_map.
3.7 KiB
3.7 KiB