summaryrefslogtreecommitdiff
path: root/Kernel/VM/PurgeableVMObject.h
AgeCommit message (Collapse)Author
2020-07-26Kernel: Switch to using AK::is and AK::downcastAndreas Kling
2020-05-08Kernel: Add for_each_vmobject_of_type<T>Andreas Kling
This makes iterating over a specific type of VMObjects a bit nicer.
2020-02-28Kernel: Expose the VMObject type of each Region in /proc/PID/vmAndreas Kling
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-12-26Kernel: When physical page allocation fails, try to purge somethingAndreas Kling
Instead of panicking right away when we run out of physical pages, we now try to find a PurgeableVMObject with some volatile pages in it. If we find one, we purge that entire object and steal one of its pages. This makes it possible for the kernel to keep going instead of dying. Very cool. :^)
2019-12-09Kernel: Start implementing purgeable memory supportAndreas Kling
It's now possible to get purgeable memory by using mmap(MAP_PURGEABLE). Purgeable memory has a "volatile" flag that can be set using madvise(): - madvise(..., MADV_SET_VOLATILE) - madvise(..., MADV_SET_NONVOLATILE) When in the "volatile" state, the kernel may take away the underlying physical memory pages at any time, without notifying the owner. This gives you a guilt discount when caching very large things. :^) Setting a purgeable region to non-volatile will return whether or not the memory has been taken away by the kernel while being volatile. Basically, if madvise(..., MADV_SET_NONVOLATILE) returns 1, that means the memory was purged while volatile, and whatever was in that piece of memory needs to be reconstructed before use.