buffer_cache: Improve buffer cache locking contention (#1973)

* Improve buffer cache locking contention

* buffer_cache: Revert some changes

* clang fmt 1

* clang fmt 2

* clang fmt 3

* buffer_cache: Fix build
This commit is contained in:
TheTurtle 2025-01-02 15:39:02 +02:00 committed by GitHub
parent 6862c9aad7
commit c25447097e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 104 additions and 240 deletions

View file

@ -185,7 +185,7 @@ void PageManager::OnGpuUnmap(VAddr address, size_t size) {
void PageManager::UpdatePagesCachedCount(VAddr addr, u64 size, s32 delta) {
static constexpr u64 PageShift = 12;
std::scoped_lock lk{mutex};
std::scoped_lock lk{lock};
const u64 num_pages = ((addr + size - 1) >> PageShift) - (addr >> PageShift) + 1;
const u64 page_start = addr >> PageShift;
const u64 page_end = page_start + num_pages;