-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LRU/reclamation work #120
Merged
LRU/reclamation work #120
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Pedro Falcato <[email protected]>
Completely rework slab cache shrinking to safe, (hopefully) correct code. Also makes the cache_list_lock a mutex. Signed-off-by: Pedro Falcato <[email protected]>
Add memory barriers for inter-process synchronization and their implementations on x86, riscv and arm64. Signed-off-by: Pedro Falcato <[email protected]>
We needed to order the previous sub_fetch(RELEASE) and load(ACQUIRE), because ACQUIRE loads do not order against prior loads and stores (i.e they're permeable in one direction). Use an smp_mb() for this ordering (wmb and rmb won't do), and relax the sub_fetch. Signed-off-by: Pedro Falcato <[email protected]>
kasan: Add extern "C" to kasan_flush_quarantine preempt.h: Add CDECLS rwlock: Add CDECLS Signed-off-by: Pedro Falcato <[email protected]>
Signed-off-by: Pedro Falcato <[email protected]>
Allocate the symtab using vmalloc. Using kmalloc provoked some really large slabs to be present for the whole of the kernel's lifetime, since boot. This reduces memory consumption quite a bit. Signed-off-by: Pedro Falcato <[email protected]>
This stops infinite busy loops due to faulty logic. Signed-off-by: Pedro Falcato <[email protected]>
heatd
force-pushed
the
pedro/lru
branch
2 times, most recently
from
May 31, 2024 02:30
5f319ad
to
9f0f762
Compare
We accidentally didn't increment the refcount when duplicating the file descriptor, which caused a use after free. Signed-off-by: Pedro Falcato <[email protected]>
Add a very basic LRU queue. Right now it does no LRU (i.e it just takes the first page in the queue), but it's a good first start and survives basic memory reclaim tests (dd if=bigfile of=/dev/null for instance). Signed-off-by: Pedro Falcato <[email protected]>
Fix error reporting after the printk rework. Signed-off-by: Pedro Falcato <[email protected]>
Add LRU-2Q page reclamation. This algorithm keeps two page queues Active and Inactive (known as Am and A1 in the original literature). We progressively promote pages from (inactive, unreferenced) -> (inactive, referenced) -> (active, unreferenced) -> (active, referenced). This gives us some sort of scan resistence. We try to keep the inactive list as at least 25% of the LRU'd page cache. It's worth noting that we have some shortcuts for page activation: - Executable or actively shared (refs > 1) pages get activated immediately - Single-referenced pages get activated or referenced (as needed) Some of the logic and heuristics were derived from [1]. Also add a way to harvest A bits from ptes to x86 and riscv (and stubbed in arm64). [1] https://lpc.events/event/11/contributions/896/attachments/793/1493/slides-r2.pdf Signed-off-by: Pedro Falcato <[email protected]>
Signed-off-by: Pedro Falcato <[email protected]>
Add a simple flock(2) implementation. It's not perfect (and doesn't yet support NFS flock(2) as-is), but it does the job for simple usage. Signed-off-by: Pedro Falcato <[email protected]>
Signed-off-by: Pedro Falcato <[email protected]>
Signed-off-by: Pedro Falcato <[email protected]>
Fix mknod. We were accidentally doing the S_BADFMT check wrong. Signed-off-by: Pedro Falcato <[email protected]>
chroot had a conflict in rv64. Signed-off-by: Pedro Falcato <[email protected]>
Add dec-and-test operation. Meant for counters actionable on counter = 0, such as the preempt counter. Signed-off-by: Pedro Falcato <[email protected]>
Generates better code. Also has a little fixup when it comes to branch annotations, which generates cleaner looking code. Signed-off-by: Pedro Falcato <[email protected]>
Add a mapcount counter to struct page, by slashing unsigned long refcount in 2 (2^32 should work for all refcounts). We maintain this mapcount when mapping/unmapping, which then reclaim easily uses to check if it can reclaim this page (or if it's pinned by someone else). This change required some consolidation of file mapping paths in filemap.cpp, and of changing all "pmap" implementations. ARM64 was not changed, but builds. Signed-off-by: Pedro Falcato <[email protected]>
Account tmpfs memory and show it in sysinfo. Signed-off-by: Pedro Falcato <[email protected]>
Use a normal fstab format (and use mntent.h while we're at it) to be compatible with other tooling. Signed-off-by: Pedro Falcato <[email protected]>
Signed-off-by: Pedro Falcato <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.