aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/generic.c
diff options
context:
space:
mode:
authorSumanth Korikkar <[email protected]>2025-08-07 18:35:45 +0000
committerAndrew Morton <[email protected]>2025-08-28 05:45:43 +0000
commitc3576889d87b603cb66b417e08844a53c1077a37 (patch)
tree8b7a41c86d02281522b376043422c2417f9dfd5b /fs/proc/generic.c
parentmm/damon/core: prevent unnecessary overflow in damos_set_effective_quota() (diff)
downloadkernel-c3576889d87b603cb66b417e08844a53c1077a37.tar.gz
kernel-c3576889d87b603cb66b417e08844a53c1077a37.zip
mm: fix accounting of memmap pages
For !CONFIG_SPARSEMEM_VMEMMAP, memmap page accounting is currently done upfront in sparse_buffer_init(). However, sparse_buffer_alloc() may return NULL in failure scenario. Also, memmap pages may be allocated either from the memblock allocator during early boot or from the buddy allocator. When removed via arch_remove_memory(), accounting of memmap pages must reflect the original allocation source. To ensure correctness: * Account memmap pages after successful allocation in sparse_init_nid() and section_activate(). * Account memmap pages in section_deactivate() based on allocation source. Link: https://lkml.kernel.org/r/[email protected] Fixes: 15995a352474 ("mm: report per-page metadata information") Signed-off-by: Sumanth Korikkar <[email protected]> Suggested-by: David Hildenbrand <[email protected]> Reviewed-by: Wei Yang <[email protected]> Cc: Alexander Gordeev <[email protected]> Cc: Gerald Schaefer <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Vasily Gorbik <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'fs/proc/generic.c')
0 files changed, 0 insertions, 0 deletions