mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 23:25:20 +00:00
Kernel: Allocate kernel stacks for threads using the region allocator.
This patch moves away from using kmalloc memory for thread kernel stacks. This reduces pressure on kmalloc (16 KB per thread adds up fast) and prevents kernel stack overflow from scribbling all over random unrelated kernel memory.
This commit is contained in:
@@ -552,6 +552,11 @@ Process::Process(String&& name, uid_t uid, gid_t gid, pid_t ppid, RingLevel ring
|
||||
{
|
||||
dbgprintf("Process: New process PID=%u with name=%s\n", m_pid, m_name.characters());
|
||||
|
||||
if (fork_parent)
|
||||
m_next_region = fork_parent->m_next_region;
|
||||
else
|
||||
m_next_region = LinearAddress(0x10000000);
|
||||
|
||||
m_page_directory = PageDirectory::create();
|
||||
#ifdef MM_DEBUG
|
||||
dbgprintf("Process %u ctor: PD=%x created\n", pid(), m_page_directory.ptr());
|
||||
@@ -596,12 +601,6 @@ Process::Process(String&& name, uid_t uid, gid_t gid, pid_t ppid, RingLevel ring
|
||||
m_fds[2].set(*device_to_use_as_tty.open(O_WRONLY).value());
|
||||
}
|
||||
|
||||
if (fork_parent)
|
||||
m_next_region = fork_parent->m_next_region;
|
||||
else
|
||||
m_next_region = LinearAddress(0x10000000);
|
||||
|
||||
|
||||
if (fork_parent) {
|
||||
m_sid = fork_parent->m_sid;
|
||||
m_pgid = fork_parent->m_pgid;
|
||||
|
||||
Reference in New Issue
Block a user