[PR #3155] [MERGED] video_core: Page manager and memory tracker improvenets #3268

Closed
opened 2026-02-27 22:03:04 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/3155
Author: @LNDF
Created: 6/24/2025
Status: Merged
Merged: 6/26/2025
Merged by: @LNDF

Base: mainHead: protect_adjust


📝 Commits (6)

📊 Changes

8 files changed (+176 additions, -42 deletions)

View changed files

📝 CMakeLists.txt (+1 -0)
📝 src/common/adaptive_mutex.h (+3 -0)
src/common/range_lock.h (+101 -0)
📝 src/video_core/buffer_cache/memory_tracker.h (+5 -5)
📝 src/video_core/buffer_cache/region_definitions.h (+7 -7)
📝 src/video_core/buffer_cache/region_manager.h (+13 -10)
📝 src/video_core/page_manager.cpp (+39 -18)
📝 src/video_core/page_manager.h (+7 -2)

📄 Description

This adds some improvements to the page manager and memory tracker:

  • Better calculation of what memory pages to (un)protect
  • Increese region manager from 4 MB to 16 MB
  • Regional locking in page manager. Currently in main, a single mutex is used to lock all watcher updates, creating a bottleneck every time memory is tracked or untracked. This creates a lock for every 1024 pages (16 MB). This is currently the same as memory tracker, I don't think it makes sense for it to be more granular.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/3155 **Author:** [@LNDF](https://github.com/LNDF) **Created:** 6/24/2025 **Status:** ✅ Merged **Merged:** 6/26/2025 **Merged by:** [@LNDF](https://github.com/LNDF) **Base:** `main` ← **Head:** `protect_adjust` --- ### 📝 Commits (6) - [`b2dec3c`](https://github.com/shadps4-emu/shadPS4/commit/b2dec3ce3c7cd994d134b302439e3bbd19fc9785) I don't know what to put here - [`1a7eb95`](https://github.com/shadps4-emu/shadPS4/commit/1a7eb95c42aa46a327f853716947c0717afa248d) clang-format - [`7d80a45`](https://github.com/shadps4-emu/shadPS4/commit/7d80a457b168de2cdb54c2c6c1118c8e2f3b008b) clang-format 2.0 - [`ff99ad6`](https://github.com/shadps4-emu/shadPS4/commit/ff99ad694ac0dc5a16f2e5999b681ca2bcc3e40e) Deadlock free locking - [`22a974b`](https://github.com/shadps4-emu/shadPS4/commit/22a974b08aea2dbc8b2464abd08fcea84d918459) Por boost range lock implementation - [`ec9c97e`](https://github.com/shadps4-emu/shadPS4/commit/ec9c97e036e3d7a824b2d34d9c045cdd4fd745e4) clang-format ### 📊 Changes **8 files changed** (+176 additions, -42 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+1 -0) 📝 `src/common/adaptive_mutex.h` (+3 -0) ➕ `src/common/range_lock.h` (+101 -0) 📝 `src/video_core/buffer_cache/memory_tracker.h` (+5 -5) 📝 `src/video_core/buffer_cache/region_definitions.h` (+7 -7) 📝 `src/video_core/buffer_cache/region_manager.h` (+13 -10) 📝 `src/video_core/page_manager.cpp` (+39 -18) 📝 `src/video_core/page_manager.h` (+7 -2) </details> ### 📄 Description This adds some improvements to the page manager and memory tracker: * Better calculation of what memory pages to (un)protect * Increese region manager from 4 MB to 16 MB * Regional locking in page manager. Currently in main, a single mutex is used to lock all watcher updates, creating a bottleneck every time memory is tracked or untracked. This creates a lock for every 1024 pages (16 MB). This is currently the same as memory tracker, I don't think it makes sense for it to be more granular. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:03:04 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#3268
No description provided.