Performance Optimization: Page Allocator Migrates from Python to C++#319
Performance Optimization: Page Allocator Migrates from Python to C++#319lianghao208 wants to merge 2 commits into
Conversation
65f0f81 to
ae4eb83
Compare
|
Thanks @lianghao208! |
|
Hi @lianghao208, Thanks for the C++ migration. After running it, I want to propose two must-fixes and a design decision. Must-fix (pushed a new commit)1. 2. The test fixture in Design decision: still support
|
Apply diff from 98d9bb3 -> 65a7d0a (lianghao208/kvcached:lianghao_c++): - csrc/page_allocator.cpp: refactor free_page/free_pages/resize/trim to use scoped lock_guard blocks instead of manual lock/unlock, making the slow-path unmap exception-safe. Also drop the max_reserved_pages_ auto-expansion in alloc_page(). - kvcached/kv_cache_manager.py: cap available_size() by physical free pages (avail_physical + reserved) in addition to virtual free pages, so capacity reported under memory pressure stays honest. Functionally equivalent to PR #319 head; the local override commits (restore-resize, bench scripts, overhead notes) sit on top.
issue #299