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:
parent
8c3ad802d8
commit
c8a216b107
6 changed files with 65 additions and 24 deletions
|
@ -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 (®ion->vmo() == this)
|
||||
callback(*region);
|
||||
}
|
||||
for (auto* region : MM.m_kernel_regions) {
|
||||
if (®ion->vmo() == this)
|
||||
callback(*region);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue