From 77737be7b3b8a6d5a9000997ec58a2d507817b6f Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 15 Aug 2019 10:29:44 +0200 Subject: [PATCH] Kernel: Stop eagerly loading entire executables We were forced to do this because the page fault code would fall apart when trying to generate a backtrace for a non-current thread. This issue has been fixed for a while now, so let's go back to lazily loading executable pages which should make everything a little better. --- Kernel/Makefile | 1 - Kernel/Process.cpp | 4 ---- Kernel/Thread.cpp | 2 -- 3 files changed, 7 deletions(-) diff --git a/Kernel/Makefile b/Kernel/Makefile index 77a48d38df3..db031937a99 100644 --- a/Kernel/Makefile +++ b/Kernel/Makefile @@ -109,7 +109,6 @@ CXXFLAGS += -nostdlib -nostdinc -nostdinc++ CXXFLAGS += -I../Toolchain/Local/i686-pc-serenity/include/c++/8.3.0/ CXXFLAGS += -I../Toolchain/Local/i686-pc-serenity/include/c++/8.3.0/i686-pc-serenity/ DEFINES += -DKERNEL -DEFINES += -DEXPENSIVE_USERSPACE_STACKS LDFLAGS += -Ttext 0x10000 -Wl,-T linker.ld -nostdlib all: $(KERNEL) kernel.map diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index 3b5cfb58362..cffb076425c 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -361,10 +361,6 @@ int Process::do_exec(String path, Vector arguments, Vector envir ASSERT(success); } -#ifdef EXPENSIVE_USERSPACE_STACKS - region->page_in(); -#endif - OwnPtr loader; { // Okay, here comes the sleight of hand, pay close attention.. diff --git a/Kernel/Thread.cpp b/Kernel/Thread.cpp index 1b836a0a30b..c90a796805d 100644 --- a/Kernel/Thread.cpp +++ b/Kernel/Thread.cpp @@ -595,11 +595,9 @@ String Thread::backtrace_impl() const if (!symbol.address) break; if (!symbol.ksym) { -#ifdef EXPENSIVE_USERSPACE_STACKS if (!Scheduler::is_active() && process.elf_loader() && process.elf_loader()->has_symbols()) builder.appendf("%p %s\n", symbol.address, process.elf_loader()->symbolicate(symbol.address).characters()); else -#endif builder.appendf("%p\n", symbol.address); continue; }