X-Received: by 10.152.37.101 with SMTP id x5mr2515764laj.5.1429984214781;
        Sat, 25 Apr 2015 10:50:14 -0700 (PDT)
X-BeenThere: linux.kernel@googlegroups.com
Received: by 10.152.88.110 with SMTP id bf14ls569994lab.48.gmail; Sat, 25 Apr
 2015 10:50:03 -0700 (PDT)
X-Received: by 10.112.171.41 with SMTP id ar9mr2522078lbc.24.1429984203041;
        Sat, 25 Apr 2015 10:50:03 -0700 (PDT)
MIME-Version: 1.0
Path: ul5ni126894lbb.0!nntp.google.com!goblin2!goblin.stu.neva.ru!aioe.org!bofh.it!news.nic.it!robomod
From: Mel Gorman <mgo...@suse.de>
Newsgroups: linux.kernel
Subject: [PATCH 1/3] x86, mm: Trace when an IPI is about to be sent
Date: Sat, 25 Apr 2015 19:50:02 +0200
Message-ID: <pjcng-5fK-5@gated-at.bofh.it>
References: <pjcng-5fK-1@gated-at.bofh.it>
X-Original-To: Linux-MM <linu...@kvack.org>
X-Mailer: git-send-email 2.3.5
Sender: rob...@news.nic.it
List-ID: <linux-kernel.vger.kernel.org>
X-Mailing-List: linux-...@vger.kernel.org
Approved: rob...@news.nic.it
Lines: 59
Organization: linux.* mail to news gateway
X-Original-Cc: Rik van Riel <ri...@redhat.com>, Hugh Dickins <hu...@google.com>,
	Minchan Kim <min...@kernel.org>,
	Dave Hansen <dave....@intel.com>,
	Andi Kleen <an...@firstfloor.org>,
	LKML <linux-...@vger.kernel.org>, Mel Gorman <mgo...@suse.de>
X-Original-Date: Sat, 25 Apr 2015 18:45:40 +0100
X-Original-Message-ID: <1429983942-4308-2-gi...@suse.de>
X-Original-References: <1429983942-4308-1-gi...@suse.de>
X-Original-Sender: linux-ker...@vger.kernel.org

It is easy to trace when an IPI is received to flush a TLB but harder to
detect what event sent it. This patch makes it easy to identify the source
of IPIs being transmitted for TLB flushes on x86.

Signed-off-by: Mel Gorman <mgo...@suse.de>
Reviewed-by: Rik van Riel <ri...@redhat.com>
Reviewed-by: Dave Hansen <dave....@intel.com>
---
 arch/x86/mm/tlb.c          | 1 +
 include/linux/mm_types.h   | 1 +
 include/trace/events/tlb.h | 3 ++-
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index 3250f2371aea..2da824c1c140 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -140,6 +140,7 @@ void native_flush_tlb_others(const struct cpumask *cpumask,
 	info.flush_end = end;
 
 	count_vm_tlb_event(NR_TLB_REMOTE_FLUSH);
+	trace_tlb_flush(TLB_REMOTE_SEND_IPI, end - start);
 	if (is_uv_system()) {
 		unsigned int cpu;
 
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 199a03aab8dc..856038aa166e 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -532,6 +532,7 @@ enum tlb_flush_reason {
 	TLB_REMOTE_SHOOTDOWN,
 	TLB_LOCAL_SHOOTDOWN,
 	TLB_LOCAL_MM_SHOOTDOWN,
+	TLB_REMOTE_SEND_IPI,
 	NR_TLB_FLUSH_REASONS,
 };
 
diff --git a/include/trace/events/tlb.h b/include/trace/events/tlb.h
index 0e7635765153..0fc101472988 100644
--- a/include/trace/events/tlb.h
+++ b/include/trace/events/tlb.h
@@ -11,7 +11,8 @@
 	{ TLB_FLUSH_ON_TASK_SWITCH,	"flush on task switch" },	\
 	{ TLB_REMOTE_SHOOTDOWN,		"remote shootdown" },		\
 	{ TLB_LOCAL_SHOOTDOWN,		"local shootdown" },		\
-	{ TLB_LOCAL_MM_SHOOTDOWN,	"local mm shootdown" }
+	{ TLB_LOCAL_MM_SHOOTDOWN,	"local mm shootdown" },		\
+	{ TLB_REMOTE_SEND_IPI,		"remote ipi send" }
 
 TRACE_EVENT_CONDITION(tlb_flush,
 
-- 
2.3.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

