Linux: decouple deleted-library maps scan cadence#2011
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughSummaryThis PR decouples the throttle for /proc/*/maps scanning into two independent schedules: one for M_LRS recalculation and one for deleted-library detection. Changes
Implementation qualityClean, minimal change that separates concerns with consistent patterns. Timestamp split and conditional invocation avoid extra scans without adding complexity. Edge cases (clearing usesDeletedLib only when relevant, periodic rechecks after unload) are handled. Code flow is straightforward and easy to review. ValidationBuild and make check passed. Manual and strace-based runtime tests show substantially fewer /proc/*/maps opens and correct clearing of deleted-library markers after unload. Commit structureSingle focused commit with clear scope and message; changes are cohesive and in-scope. WalkthroughThe PR adds a new timestamp field, last_deleted_lib_calctime, to LinuxProcess. The recursion logic now computes two independent booleans—checkLrs and checkDeletedLib—using separate last-calculation timestamps and randomized recheck intervals. LinuxProcessTable_readMaps is called only when at least one check triggers; each check’s timestamp is updated independently. When neither check triggers, proc->usesDeletedLib and lp->m_lrs are cleared only under the appropriate conditional paths. Poem
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: a6f6241f-5f9d-47ab-91ae-5e92467671bd
📒 Files selected for processing (2)
linux/LinuxProcess.hlinux/LinuxProcessTable.c
d384ae4 to
166a457
Compare
Summary
When deleted executable/library highlighting is enabled, Linux process refresh currently shares the same
last_mlrs_calctimethrottle for both theM_LRScolumn and deleted-library detection.That couples two different behaviours:
M_LRScan need frequent maps scans while the column is visible.M_LRS-only scan.This adds a separate
last_deleted_lib_calctime, clearsusesDeletedLibonly when the deleted-library check actually runs, and keeps a periodic deleted-library recheck so the marker can clear after a process unloads the deleted mapping.Validation
./autogen.sh && ./configure && make -j8make checkgit diff --check origin/main...HEADdlopen()s a temporary shared object and unlinks it while it remains mapped.EXEandM_LRScolumns confirmed the process row is rendered andM_LRSis populated.strace -yycomparison with onlyEXE/Commandvisible and deleted-library highlighting enabled:mapsopens, 2 for the target processmain, ~15.4s: 3450 totalmapsopens, 9 for the target processdlclose()d the deleted library after startup; the patched branch rechecked the target maps 4 times during a ~35.7s run after the mapping disappeared.