LKML Archive on
help / color / mirror / Atom feed
From: Dave Hansen <>
Cc: Dave Hansen <>,,
Subject: [PATCH 2/2] x86 tlb: fix tracepoint nr_pages calculation
Date: Mon, 08 Dec 2014 11:03:49 -0800	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

From: Dave Hansen <>

We calculate nr_pages with f->flush_end and f->flush_start, both
of which are virtual addresses.  However, we only divide
f->flush_start by PAGE_SIZE, and missed f->flush_end.  This patch
adds some parenthesis to catch f->flush_end as well.

nr_pages is only used for a trace point.  This should not have
any functional impact other than keeping the trace point from
spitting out garbage for the flush length.

Signed-off-by: Dave Hansen <>

 b/arch/x86/mm/tlb.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN arch/x86/mm/tlb.c~x86-tlb-fix-tracepoint-data arch/x86/mm/tlb.c
--- a/arch/x86/mm/tlb.c~x86-tlb-fix-tracepoint-data	2014-12-08 10:58:22.245782512 -0800
+++ b/arch/x86/mm/tlb.c	2014-12-08 10:58:22.248782647 -0800
@@ -129,7 +129,7 @@ static void flush_tlb_func(void *info)
 		} else {
 			unsigned long addr;
 			unsigned long nr_pages =
-				f->flush_end - f->flush_start / PAGE_SIZE;
+				(f->flush_end - f->flush_start) / PAGE_SIZE;
 			addr = f->flush_start;
 			while (addr < f->flush_end) {

      reply	other threads:[~2014-12-08 19:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-08 19:03 [PATCH 1/2] x86 tlb: fix overflow of flush_end in remote tlb flush Dave Hansen
2014-12-08 19:03 ` Dave Hansen [this message]

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:

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

  git send-email \ \ \ \ \ \
    --subject='Re: [PATCH 2/2] x86 tlb: fix tracepoint nr_pages calculation' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).