Skip to content

Commit 475a2f9

Browse files
tehcastertorvalds
authored andcommitted
mm: fix swapped Movable and Reclaimable in /proc/pagetypeinfo
Commit 016c13d ("mm, page_alloc: use masks and shifts when converting GFP flags to migrate types") has swapped MIGRATE_MOVABLE and MIGRATE_RECLAIMABLE in the enum definition. However, migratetype_names wasn't updated to reflect that. As a result, the file /proc/pagetypeinfo shows the counts for Movable as Reclaimable and vice versa. Additionally, commit 0aaa29a ("mm, page_alloc: reserve pageblocks for high-order atomic allocations on demand") introduced MIGRATE_HIGHATOMIC, but did not add a letter to distinguish it into show_migration_types(), so it doesn't appear in the listing of free areas during page alloc failures or oom kills. This patch fixes both problems. The atomic reserves will show with a letter 'H' in the free areas listings. Fixes: 016c13d ("mm, page_alloc: use masks and shifts when converting GFP flags to migrate types") Fixes: 0aaa29a ("mm, page_alloc: reserve pageblocks for high-order atomic allocations on demand") Signed-off-by: Vlastimil Babka <[email protected]> Acked-by: Mel Gorman <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 9516a18 commit 475a2f9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

mm/page_alloc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3647,8 +3647,9 @@ static void show_migration_types(unsigned char type)
36473647
{
36483648
static const char types[MIGRATE_TYPES] = {
36493649
[MIGRATE_UNMOVABLE] = 'U',
3650-
[MIGRATE_RECLAIMABLE] = 'E',
36513650
[MIGRATE_MOVABLE] = 'M',
3651+
[MIGRATE_RECLAIMABLE] = 'E',
3652+
[MIGRATE_HIGHATOMIC] = 'H',
36523653
#ifdef CONFIG_CMA
36533654
[MIGRATE_CMA] = 'C',
36543655
#endif

mm/vmstat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,8 +921,8 @@ static void walk_zones_in_node(struct seq_file *m, pg_data_t *pgdat,
921921
#ifdef CONFIG_PROC_FS
922922
static char * const migratetype_names[MIGRATE_TYPES] = {
923923
"Unmovable",
924-
"Reclaimable",
925924
"Movable",
925+
"Reclaimable",
926926
"HighAtomic",
927927
#ifdef CONFIG_CMA
928928
"CMA",

0 commit comments

Comments
 (0)