diff options
author | Tom <tomut@yahoo.com> | 2020-07-06 12:47:08 -0600 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-06 22:39:06 +0200 |
commit | 06d50f64b0b67fd94854b6c9f85f29ab3b0b38e5 (patch) | |
tree | db25d72df16ec1327c6ce443e900e0793391c357 /Kernel/VM/Region.h | |
parent | 56126d7a4526e2c39ccf0c8ea0488d209ee04dd8 (diff) | |
download | serenity-06d50f64b0b67fd94854b6c9f85f29ab3b0b38e5.zip |
Kernel: Aggregate TLB flush requests for Regions for SMP
Rather than sending one TLB flush request for each page,
aggregate them so that we're not spamming the other
processors with FlushTLB IPIs.
Diffstat (limited to 'Kernel/VM/Region.h')
-rw-r--r-- | Kernel/VM/Region.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Kernel/VM/Region.h b/Kernel/VM/Region.h index d2dc634f5c..91c4dd8822 100644 --- a/Kernel/VM/Region.h +++ b/Kernel/VM/Region.h @@ -117,6 +117,11 @@ public: { return (vaddr - m_range.base()).get() / PAGE_SIZE; } + + VirtualAddress vaddr_from_page_index(size_t page_index) const + { + return vaddr().offset(page_index * PAGE_SIZE); + } size_t first_page_index() const { @@ -151,7 +156,6 @@ public: } bool commit(); - bool commit(size_t page_index); size_t amount_resident() const; size_t amount_shared() const; @@ -175,7 +179,6 @@ public: void unmap(ShouldDeallocateVirtualMemoryRange = ShouldDeallocateVirtualMemoryRange::Yes); void remap(); - void remap_page(size_t index); // For InlineLinkedListNode Region* m_next { nullptr }; @@ -197,6 +200,9 @@ private: m_access &= ~access; } + bool commit(size_t page_index); + void remap_page(size_t index, bool with_flush = true); + PageFaultResponse handle_cow_fault(size_t page_index); PageFaultResponse handle_inode_fault(size_t page_index); PageFaultResponse handle_zero_fault(size_t page_index); |