Skip to content

Commit 4185663

Browse files
hcahcaAlexander Gordeev
authored andcommitted
s390/mm: Fix DirectMap accounting
With uncoupling of physical and virtual address spaces population of the identity mapping was changed to use the type POPULATE_IDENTITY instead of POPULATE_DIRECT. This breaks DirectMap accounting: > cat /proc/meminfo DirectMap4k: 55296 kB DirectMap1M: 18446744073709496320 kB Adjust all locations of update_page_count() in vmem.c to use POPULATE_IDENTITY instead of POPULATE_DIRECT as well. With this accounting is correct again: > cat /proc/meminfo DirectMap4k: 54264 kB DirectMap1M: 8334336 kB Fixes: c98d2ec ("s390/mm: Uncouple physical vs virtual address spaces") Cc: [email protected] Reviewed-by: Alexander Gordeev <[email protected]> Signed-off-by: Heiko Carstens <[email protected]> Signed-off-by: Alexander Gordeev <[email protected]>
1 parent fac04ef commit 4185663

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/s390/boot/vmem.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ static void pgtable_pte_populate(pmd_t *pmd, unsigned long addr, unsigned long e
306306
pages++;
307307
}
308308
}
309-
if (mode == POPULATE_DIRECT)
309+
if (mode == POPULATE_IDENTITY)
310310
update_page_count(PG_DIRECT_MAP_4K, pages);
311311
}
312312

@@ -339,7 +339,7 @@ static void pgtable_pmd_populate(pud_t *pud, unsigned long addr, unsigned long e
339339
}
340340
pgtable_pte_populate(pmd, addr, next, mode);
341341
}
342-
if (mode == POPULATE_DIRECT)
342+
if (mode == POPULATE_IDENTITY)
343343
update_page_count(PG_DIRECT_MAP_1M, pages);
344344
}
345345

@@ -372,7 +372,7 @@ static void pgtable_pud_populate(p4d_t *p4d, unsigned long addr, unsigned long e
372372
}
373373
pgtable_pmd_populate(pud, addr, next, mode);
374374
}
375-
if (mode == POPULATE_DIRECT)
375+
if (mode == POPULATE_IDENTITY)
376376
update_page_count(PG_DIRECT_MAP_2G, pages);
377377
}
378378

0 commit comments

Comments
 (0)