mm/vmstat.c: skip NR_TLB_REMOTE_FLUSH* properly
Subsystems (3)
[email protected]
maintainerPATCH 11/14 mm/vmstat.c: skip NR_TLB_REMOTE_FLUSH* properly
From: Jann Horn <[email protected]>
Subject: mm/vmstat.c: skip NR_TLB_REMOTE_FLUSH* properly
5dd0b16cdaff ("mm/vmstat: Make NR_TLB_REMOTE_FLUSH_RECEIVED available even on UP") made the availability of the NR_TLB_REMOTE_FLUSH* counters inside the kernel unconditional to reduce #ifdef soup, but (either to avoid showing dummy zero counters to userspace, or because that code was missed) didn't update the vmstat_array, meaning that all following counters would be shown with incorrect values.
This only affects kernel builds with CONFIG_VM_EVENT_COUNTERS=y && CONFIG_DEBUG_TLBFLUSH=y && CONFIG_SMP=n.
Fixes 5dd0b16cdaff ("mm/vmstat: Make NR_TLB_REMOTE_FLUSH_RECEIVED available even on UP")
Signed-off-by Jann Horn <[email protected]>
Reviewed-by Kees Cook <[email protected]>
Reviewed-by Andrew Morton <[email protected]>
Acked-by Michal Hocko <[email protected]>
Acked-by Roman Gushchin <[email protected]>
Cc Davidlohr Bueso <[email protected]>
Cc Oleg Nesterov <[email protected]>
Cc Christoph Lameter <[email protected]>
Cc Kemi Wang <[email protected]>
Cc Andy Lutomirski <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
mm/vmstat.c | 3 +++ 1 file changed, 3 insertions(+)
mm/vmstat.c renamed from mm/vmstat.c~mm-vmstat-skip-nr_tlb_remote_flush-properly +3 -0
@@ -1275,6 +1275,9 @@ const char * const vmstat_text[] = {#ifdef CONFIG_SMP "nr_tlb_remote_flush" ,"nr_tlb_remote_flush_received" , +#else +"" ,/* nr_tlb_remote_flush */ +"" ,/* nr_tlb_remote_flush_received */ #endif /* CONFIG_SMP */"nr_tlb_local_flush_all" , "nr_tlb_local_flush_one",
_