Commit c6808a8
authored
fix(mm): balance page cache membership accounting (#2131)
* fix(mm): balance page cache membership accounting
Track immutable file and shmem membership on each page-cache entry so removal and final cache teardown can update VM counters exactly once without upgrading an owner that is already being destroyed.
Keep dirty, writeback, and unevictable accounting tied to the currently mapped entry. Revalidate entry identity across truncate and writeback completion, and require the legacy reclaimer to claim the expected physical page before submitting stale snapshots.
Preserve the existing PageEntry layout, use vacant-only insertion, and align tmpfs construction with immutable shmem classification. Add a debugfs accounting selftest and dunitest coverage for membership, inflight teardown, late completion, aggregate VM wiring, and layout stability.
Validated with make fmt, make kernel, the page-cache accounting dunitest, FUSE core and extended suites, repeated non-DAX VirtioFS mount/read/unmount beyond guest RAM, and CubeSandbox master/candidate performance checks.
Signed-off-by: longjin <longjin@dragonos.org>1 parent 56acd9b commit c6808a8
6 files changed
Lines changed: 661 additions & 101 deletions
File tree
- kernel/src
- debug
- filesystem
- tmpfs
- mm
- user/apps/tests/dunitest
- suites/normal
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
| |||
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
58 | 102 | | |
59 | 103 | | |
60 | 104 | | |
| |||
71 | 115 | | |
72 | 116 | | |
73 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
74 | 125 | | |
75 | 126 | | |
0 commit comments