From 38b13f150852938b2ed1e7c324cb18a1a25ae7b0 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 21 Jul 2019 19:51:32 +0200 Subject: [PATCH] Kernel: Remove bitrotted "spawn stress" code. This was something I used during early kernel development to spam creation of new processes to see if the kernel could handle it. --- Kernel/init.cpp | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/Kernel/init.cpp b/Kernel/init.cpp index 6a8f81f610..1b7c243311 100644 --- a/Kernel/init.cpp +++ b/Kernel/init.cpp @@ -34,8 +34,6 @@ #include #include -//#define STRESS_TEST_SPAWNING - VirtualConsole* tty0; VirtualConsole* tty1; VirtualConsole* tty2; @@ -51,24 +49,6 @@ SerialDevice* ttyS2; SerialDevice* ttyS3; VFS* vfs; -#ifdef STRESS_TEST_SPAWNING -[[noreturn]] static void spawn_stress() -{ - u32 last_sum_alloc = sum_alloc; - - for (unsigned i = 0; i < 10000; ++i) { - int error; - Process::create_user_process("/bin/true", (uid_t)100, (gid_t)100, (pid_t)0, error, {}, {}, tty0); - dbgprintf("malloc stats: alloc:%u free:%u eternal:%u !delta:%u\n", sum_alloc, sum_free, kmalloc_sum_eternal, sum_alloc - last_sum_alloc); - last_sum_alloc = sum_alloc; - sleep(60); - } - for (;;) { - asm volatile("hlt"); - } -} -#endif - [[noreturn]] static void init_stage2() { Syscall::initialize(); @@ -165,10 +145,6 @@ VFS* vfs; } system_server_process->set_priority(Process::HighPriority); -#ifdef STRESS_TEST_SPAWNING - Process::create_kernel_process("spawn_stress", spawn_stress); -#endif - current->process().sys$exit(0); ASSERT_NOT_REACHED(); }