mm: fix PMD level mTHP accounting bugs
Status from this message: [merged mm-hotfixes-stable] mm-migrate-exclude-hugetlb-folios-from-mthp_stat_nr_anon-accounting.patch removed from -mm tree
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest2 patches 5 repliesApplied 2/2
- v12 patches 6 repliesSuperseded
Changes in v2 from the cover letter
- add RB from Zi
- Drop unnecessary check in __folio_migrate_folio(). HugeTLB has its own migration system in hugetlbfs_migrate_folio().
Patches in v2 All 2 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | mm: decrement MTHP_STAT_NR_ANON in free_zone_device_folio()mm/ | +1 | 0 replies | Applied |
| 2/2 | mm/migrate: exclude hugetlb folios from MTHP_STAT_NR_ANON accountingmm/ | +2 | 1 reply | Applied |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Zi Yan | Baolin Wang |
|---|---|---|
| 1/2 | R-b | |
| 2/2 | R-b | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/2] mm: fix PMD level mTHP accounting bugs
While running selftests I noticed the PMD level per-mTHP stats (nr_anon) remained elevated after each run. After further investigation I noticed this accounting error occurs for both the migration.private_anon_htlb_test and the HMM tests.
In the HMM case this is due to folio_add_new_anon_rmap() incrementing the mTHP stats, but never containing a corresponding decrement in free_zone_device_folio(). We solve this by making sure to decrement the counter when freeing device memory.
In the migration case, we are incrementing this counter without first checking whether this folio is a hugetlb folio, which relies on a separate accounting system. We solve this by adding the proper hugetlb check before incrementing this counter.
With these changes in place, the two tests no longer cause elevated PMD level accounting issues.
V2 Changes:
- add RB from Zi
- Drop unnecessary check in __folio_migrate_folio(). HugeTLB has its own migration system in hugetlbfs_migrate_folio().
V1: https://lore.kernel.org/all/[email protected]/
Nico Pache (2):
mm: decrement MTHP_STAT_NR_ANON in free_zone_device_folio() mm/migrate: exclude hugetlb folios from MTHP_STAT_NR_ANON accounting
mm/memremap.c | 1 + mm/migrate.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-)
base-commit: e57d6e9e20b551e4910d7a6331a81775c3ad6693
Signature · 1 line
2.55.0