All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jann Horn <jannh@google.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, jannh@google.com
Cc: Davidlohr Bueso <dave@stgolabs.net>,
	Oleg Nesterov <oleg@redhat.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Christoph Lameter <clameter@sgi.com>,
	Roman Gushchin <guro@fb.com>, Kemi Wang <kemi.wang@intel.com>,
	Kees Cook <keescook@chromium.org>,
	Andy Lutomirski <luto@kernel.org>, Ingo Molnar <mingo@kernel.org>
Subject: [PATCH v2 2/3] mm/vmstat: skip NR_TLB_REMOTE_FLUSH* properly
Date: Mon,  1 Oct 2018 16:31:37 +0200	[thread overview]
Message-ID: <20181001143138.95119-2-jannh@google.com> (raw)
In-Reply-To: <20181001143138.95119-1-jannh@google.com>

commit 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")
Cc: stable@vger.kernel.org
Signed-off-by: Jann Horn <jannh@google.com>
---
 mm/vmstat.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mm/vmstat.c b/mm/vmstat.c
index 4cea7b8f519d..7878da76abf2 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -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",
-- 
2.19.0.605.g01d371f741-goog

  reply	other threads:[~2018-10-01 14:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-01 14:31 [PATCH v2 1/3] mm/vmstat: fix outdated vmstat_text Jann Horn
2018-10-01 14:31 ` Jann Horn [this message]
2018-10-01 15:57   ` [PATCH v2 2/3] mm/vmstat: skip NR_TLB_REMOTE_FLUSH* properly Kees Cook
2018-10-04  7:22   ` Michal Hocko
2018-10-01 14:31 ` [PATCH v2 3/3] mm/vmstat: assert that vmstat_text is in sync with stat_items_size Jann Horn
2018-10-01 15:57   ` Kees Cook
2018-10-04  7:23   ` Michal Hocko
2018-10-04 16:34   ` Roman Gushchin
2018-10-01 15:56 ` [PATCH v2 1/3] mm/vmstat: fix outdated vmstat_text Kees Cook
2018-10-04  7:19 ` Michal Hocko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181001143138.95119-2-jannh@google.com \
    --to=jannh@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=clameter@sgi.com \
    --cc=dave@stgolabs.net \
    --cc=guro@fb.com \
    --cc=keescook@chromium.org \
    --cc=kemi.wang@intel.com \
    --cc=linux-mm@kvack.org \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.