Skip to content

mm: rework MGLRU workingset protection - #19

Draft
raz123 wants to merge 1 commit into
codex/mglru-bootloop-investigationfrom
feature/mglru-workingset-protection-page
Draft

mm: rework MGLRU workingset protection#19
raz123 wants to merge 1 commit into
codex/mglru-bootloop-investigationfrom
feature/mglru-workingset-protection-page

Conversation

@raz123

@raz123 raz123 commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Feature summary

Port Yu Zhao's MGLRU workingset-protection rework to this page-based Linux 4.19.325 tree. File-descriptor references now use the reference-bit mask, PG_workingset represents the highest tier, and lazy promotion is preserved through generation movement and refault handling.

Source provenance

  • Upstream: Yu Zhao, commit 4d5d14a01e2c9091b128fb46e1d07475e9a7bb72
  • Subject: mm/mglru: rework workingset protection
  • Source license: GPL-2.0
  • This is a minimal page-based adaptation; no direct cherry-pick was possible because upstream is folio/newer-kernel based.

Baseline and branch

  • Baseline: origin/codex/mglru-bootloop-investigation at 75249a53957b5725b695ca0af6b7825d7ef31c57
  • Branch: feature/mglru-workingset-protection-page
  • Commit: f4fc226092387263c9101172c70235b8de767cd8

Exact files changed

  • include/linux/mm_inline.h
  • include/linux/mmzone.h
  • mm/swap.c
  • mm/vmscan.c
  • mm/workingset.c

ABI and userspace behavior

No framework, ROM, device-tree, sepolicy, or userspace changes. Existing MGLRU sysfs/debugfs controls and vmstat interfaces remain in place; only reclaim tier classification and workingset protection behavior change.

Regression gate

  1. Testing: MGLRU workingset protection, lazy promotion, deactivation clearing, and page-based refault tier restoration.
  2. Baseline diff: zero before edits against the exact integration SHA above.
  3. Failure meaning: a failure indicates a porting or reclaim-lifecycle regression, not a mixed feature failure.
  4. Isolation: only the five MGLRU MM/header files changed; KSU stayed enabled and no target/device/userspace variables changed.
  5. Import/adaptation: yes—clean upstream import intent with minimal page-API adaptations; the target's existing refault-age check was retained as a separate prior experiment.

CI and artifact

  • CI run 29380499564
  • Result: success; KSU, manual hook, KALLSYMS, SELinux, Binder, image-size, DTB and DTBO gates passed.
  • Artifact: flashable-anykernel3 (ID 8329656734)
  • Inner flashable ZIP: rp-pocof3_ReSukiSU_b275.zip
  • Inner ZIP SHA-256: 843c9b4b0d84b3d3c0bc4958daad0f848ca9365ffa7b44d600d27b5379f30d2c
  • Embedded identity: 4.19.325-cip130-st14-aptusitu-perf-b275-gf4fc22609238 #275

Device verification

b275 was validated read-only on alioth: Android 13, boot complete, cold boot, slot _b, and exact kernel identity 4.19.325-cip130-st14-aptusitu-perf-b275-gf4fc22609238 #275 matching CI. CONFIG_LRU_GEN=y, CONFIG_LRU_GEN_ENABLED=y, runtime enabled=0x0003, and live /sys/kernel/debug/lru_gen generation data were present. Refault/reclaim counters were active; oom_kill=0, and the kernel log scan found no panic, Oops, BUG, watchdog, OOM-killer, or RCU-stall match.

Known limitations

This is a page-based 4.19 port, not a direct folio backport. The newer PTE-mapped large-folio follow-up and newer reclaim/writeback series are intentionally excluded. Runtime performance impact is unmeasured.

Next test

Run a controlled b274 versus b275 A/B workload with fixed app set, reboot state, and measurement window. Compare refaults, activation/restoration, reclaim scan/steal, latency, memory pressure, and battery; do not infer performance from lifetime counters alone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant