mm: huge_memory: clean up defrag sysfs with shared data tables
Status from this message: [merged mm-stable] mm-huge_memory-refactor-defrag_show-to-use-defrag_flags.patch removed from -mm tree
Get series with b4
b4 am [email protected] change-id 20260320-thp_defrag-540fc4f1fa3dVersions newest first
- v2 Latest2 patches 3 repliesApplied 2/2
- v12 patches 9 repliesSuperseded
Changes in v2 from the cover letter
- Do not be too verbose on enum defrag_mode (David Hildenbrand)
- Link to v1: https://patch.msgid.link/[email protected]
Patches in v2 All 2 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | mm: huge_memory: use sysfs_match_string() in defrag_store()mm/ | +34 | 1 reply | Applied |
| 2/2 | mm: huge_memory: refactor defrag_show() to use defrag_flags[]mm/ | +22 | 1 reply | Applied |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | David Hildenbrand (Arm) | Lance Yang | Barry Song | Zi Yan | Lorenzo Stoakes |
|---|---|---|---|---|---|
| Series | T-b A-b | ||||
| 1/2 | A-b | T-b R-b | R-b | R-b | |
| 2/2 | A-b | T-b R-b | R-b | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.
Cover letter [PATCH v2 0/2] mm: huge_memory: clean up defrag sysfs with shared data tables
Refactor defrag_store() and defrag_show() to use shared data tables instead of duplicated if/else chains.
Patch 1 introduces an enum defrag_mode, a defrag_mode_strings[] table, and a defrag_flags[] mapping array, then rewrites defrag_store() to use sysfs_match_string() with a loop over defrag_flags[].
Patch 2 refactors defrag_show() to use the same arrays, replacing its hardcoded if/else chain of test_bit() calls and string literals.
This follows the same pattern applied to anon_enabled_store() in commit 522dfb4ba71f ("mm: huge_memory: refactor anon_enabled_store() with change_anon_orders()").
Breno Leitao (2):
mm: huge_memory: use sysfs_match_string() in defrag_store()
mm: huge_memory: refactor defrag_show() to use defrag_flags[]
---
Changes in v2:
- Do not be too verbose on enum defrag_mode (David Hildenbrand)
- Link to v1: https://patch.msgid.link/[email protected]
---
Breno Leitao (2):
mm: huge_memory: use sysfs_match_string() in defrag_store()
mm: huge_memory: refactor defrag_show() to use defrag_flags[]
mm/huge_memory.c | 98 ++++++++++++++++++++++++++++++++------------------------ 1 file changed, 56 insertions(+), 42 deletions(-)
---
base-commit: f3e6330d7fe42b204af05a2dbc68b379e0ad179e
change-id: 20260320-thp_defrag-540fc4f1fa3d
Best regards,
Signature · 1 line
Breno Leitao <[email protected]>