summaryrefslogtreecommitdiff
path: root/Kernel/VM/PhysicalRegion.h
AgeCommit message (Collapse)Author
2021-07-11Kernel: Remove pointless ref-counting from PhysicalRegionAndreas Kling
These are not multiple-owner objects and have no use for ref-counting. Make them simple value types instead (not eternal heap-allocated.)
2021-07-08Kernel: Return an already destructed PhysicalPage to the allocatorsTom
By making sure the PhysicalPage instance is fully destructed the allocators will have a chance to reclaim the PhysicalPageEntry for free-list purposes. Just pass them the physical address of the page that was freed, which is enough to lookup the PhysicalPageEntry later.
2021-07-08Kernel: Move PhysicalPage classes out of the heap into an arrayTom
By moving the PhysicalPage classes out of the kernel heap into a static array, one for each physical page, we can avoid the added overhead and easily find them by indexing into an array. This also wraps the PhysicalPage into a PhysicalPageEntry, which allows us to re-use each slot with information where to find the next free page.
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-02-28Kernel: Use default con/de-structorsBen Wiederhake
This may seem like a no-op change, however it shrinks down the Kernel by a bit: .text -432 .unmap_after_init -60 .data -480 .debug_info -673 .debug_aranges 8 .debug_ranges -232 .debug_line -558 .debug_str -308 .debug_frame -40 With '= default', the compiler can do more inlining, hence the savings. I intentionally omitted some opportunities for '= default', because they would increase the Kernel size.
2021-01-28Kernel: Allow specifying a physical alignment when allocatingTom
Some drivers may require allocating contiguous physical pages with a specific alignment for the physical address.
2020-09-25Meta+Kernel: Make clang-format-10 cleanBen Wiederhake
2020-09-09Kernel: Optimize single physical page allocation and randomize returnsTom
Rather than trying to find a contiguous set of bits of size 1, just find one single available bit using a hint. Also, try to randomize returned physical pages a bit by placing them into a 256 entry queue rather than making them available immediately. Then, once the queue is filled, pick a random one, make it available again and use that slot for the latest page to be returned.
2020-08-30Kernel: Remove unused variable PhysicalRegion::m_lastAndreas Kling
2020-08-25Kernel: Make PhysicalPage not movable and use atomic ref countingTom
We should not be moving ref-counted objects.
2020-08-22Revert "Kernel: Make PhysicalPage not movable and use atomic ref counting"Andreas Kling
This reverts commit a89ccd842becdfbc951436da5384d8819374e0f4.
2020-08-22Kernel: Make PhysicalPage not movable and use atomic ref countingTom
We should not be moving ref-counted objects.
2020-05-08Kernel: Use NonnullRefPtrVector<T> instead of Vector<RefPtr<T>> someAndreas Kling
2020-03-08Kernel: Allow contiguous allocations in physical memoryLiav A
For that, we have a new type of VMObject, called ContiguousVMObject, that is responsible for allocating contiguous physical pages.
2020-02-16Kernel: Move all code into the Kernel namespaceAndreas Kling
2020-01-18Meta: Add license header to source filesAndreas Kling
As suggested by Joshua, this commit adds the 2-clause BSD license as a comment block to the top of every source file. For the first pass, I've just added myself for simplicity. I encourage everyone to add themselves as copyright holders of any file they've added or modified in some significant way. If I've added myself in error somewhere, feel free to replace it with the appropriate copyright holder instead. Going forward, all new source files should include a license header.
2019-07-09Kernel: Move PhysicalAddress.h into VM/Andreas Kling
2019-06-21AK: Rename Retainable.h => RefCounted.h.Andreas Kling
2019-06-21AK: Rename RetainPtr.h => RefPtr.h, Retained.h => NonnullRefPtr.h.Andreas Kling
2019-06-21AK: Rename RetainPtr => RefPtr and Retained => NonnullRefPtr.Andreas Kling
2019-06-21AK: Rename Retainable => RefCounted.Andreas Kling
(And various related renames that go along with it.)
2019-06-14VM: Pass a PhysicalPage by rvalue reference when returning it to the freelist.Sergey Bugaev
This makes no functional difference, but it makes it clear that MemoryManager and PhysicalRegion take over the actual physical page represented by this PhysicalPage instance.
2019-06-12Kernel: Refactor MemoryManager to use a Bitmap rather than a VectorConrad Pankoff
This significantly reduces the pressure on the kernel heap when allocating a lot of pages. Previously at about 250MB allocated, the free page list would outgrow the kernel's heap. Given that there is no longer a page list, this does not happen. The next barrier will be the kernel memory used by the page records for in-use memory. This kicks in at about 1GB.