summaryrefslogtreecommitdiff
path: root/Kernel/Memory/PhysicalRegion.h
AgeCommit message (Collapse)Author
2021-12-28Kernel: Remove the kmalloc_eternal heap :^)Andreas Kling
This was a premature optimization from the early days of SerenityOS. The eternal heap was a simple bump pointer allocator over a static byte array. My original idea was to avoid heap fragmentation and improve data locality, but both ideas were rooted in cargo culting, not data. We would reserve 4 MiB at boot and only ended up using ~256 KiB, wasting the rest. This patch replaces all kmalloc_eternal() usage by regular kmalloc().
2021-12-22Kernel: Initialize PhysicalRegion::m_large_zones, remove m_small_zonesBrian Gianforcaro
Found by PVS Studio Static Analysis.
2021-12-13Kernel: Replace final loop in PhysicalRegion::return_page() with mathClay Freeman
Since it's possible to determine where the small zones will start to occur for each PhysicalRegion, we can use arithmetic so that the call time for both large and small zones is identical.
2021-12-11Kernel: Make PhysicalRegion::return_page() do arithmetic instead of loopAndreas Kling
Most of the time, we will be freeing physical pages within the full-sized zones. We can do some simple math to find the right zone immediately instead of looping through the zones, checking each one. We still do loop through the slack/remainder zones at the end. There's probably an even nicer way to solve this, but this is already a nice improvement. :^)
2021-08-06Kernel: Move Kernel/Memory/ code into Kernel::Memory namespaceAndreas Kling
2021-08-06Kernel: Rename Kernel/VM/ to Kernel/Memory/Andreas Kling
This directory isn't just about virtual memory, it's about all kinds of memory management.