From f5d779f47e5d1859571ec0778d78454a610602f9 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 26 Aug 2019 13:18:17 +0200 Subject: Kernel: Never forcibly page in entire executables We were doing this for the initial kernel-spawned userspace process(es) to work around instability in the page fault handler. Now that the page fault handler is more robust, we can stop worrying about this. Specifically, the page fault handler was previous not able to handle getting a page fault in anything but the currently executing task's page directory. --- Kernel/Process.cpp | 6 ------ Kernel/VM/Region.cpp | 20 -------------------- Kernel/VM/Region.h | 1 - 3 files changed, 27 deletions(-) (limited to 'Kernel') diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index e324aa836f..9a519ed4c4 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -359,12 +359,6 @@ int Process::do_exec(String path, Vector arguments, Vector envir RefPtr region = allocate_region_with_vmo(VirtualAddress(), metadata.size, vmo, 0, description->absolute_path(), PROT_READ); ASSERT(region); - if (this != ¤t->process()) { - // FIXME: Don't force-load the entire executable at once, let the on-demand pager take care of it. - bool success = region->page_in(); - ASSERT(success); - } - OwnPtr loader; { // Okay, here comes the sleight of hand, pay close attention.. diff --git a/Kernel/VM/Region.cpp b/Kernel/VM/Region.cpp index 537101cf8a..ebe9a576fb 100644 --- a/Kernel/VM/Region.cpp +++ b/Kernel/VM/Region.cpp @@ -46,26 +46,6 @@ Region::~Region() MM.unregister_region(*this); } -bool Region::page_in() -{ - ASSERT(m_page_directory); - ASSERT(vmo().is_inode()); -#ifdef MM_DEBUG - dbgprintf("MM: page_in %u pages\n", page_count()); -#endif - for (size_t i = 0; i < page_count(); ++i) { - auto& vmo_page = vmo().physical_pages()[first_page_index() + i]; - if (vmo_page.is_null()) { - bool success = MM.page_in_from_inode(*this, i); - if (!success) - return false; - continue; - } - MM.remap_region_page(*this, i); - } - return true; -} - NonnullRefPtr Region::clone() { ASSERT(current); diff --git a/Kernel/VM/Region.h b/Kernel/VM/Region.h index 32e02193fe..5d4a12cf89 100644 --- a/Kernel/VM/Region.h +++ b/Kernel/VM/Region.h @@ -71,7 +71,6 @@ public: return size() / PAGE_SIZE; } - bool page_in(); int commit(); size_t amount_resident() const; -- cgit v1.2.3