1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 17:35:07 +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:
Andreas Kling 2019-05-14 11:51:00 +02:00
parent 8c3ad802d8
commit c8a216b107
6 changed files with 65 additions and 24 deletions

View file

@ -80,7 +80,11 @@ void VMObject::for_each_region(Callback callback)
{
// FIXME: Figure out a better data structure so we don't have to walk every single region every time an inode changes.
// Perhaps VMObject could have a Vector<Region*> with all of his mappers?
for (auto* region : MM.m_regions) {
for (auto* region : MM.m_user_regions) {
if (&region->vmo() == this)
callback(*region);
}
for (auto* region : MM.m_kernel_regions) {
if (&region->vmo() == this)
callback(*region);
}