summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-08-26 13:18:17 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-08-26 13:20:01 +0200
commitf5d779f47e5d1859571ec0778d78454a610602f9 (patch)
treed3612027e199782a3c32bbcb5944fb53dca5fc8f /Kernel
parente29fd3cd20ff775b197716403e03b30db6bd7923 (diff)
downloadserenity-f5d779f47e5d1859571ec0778d78454a610602f9.zip
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.
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/Process.cpp6
-rw-r--r--Kernel/VM/Region.cpp20
-rw-r--r--Kernel/VM/Region.h1
3 files changed, 0 insertions, 27 deletions
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<String> arguments, Vector<String> envir
RefPtr<Region> region = allocate_region_with_vmo(VirtualAddress(), metadata.size, vmo, 0, description->absolute_path(), PROT_READ);
ASSERT(region);
- if (this != &current->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<ELFLoader> 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> 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;