From patchwork Wed Apr 10 22:44:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atish Patra X-Patchwork-Id: 10894829 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ED0AA17E6 for ; Wed, 10 Apr 2019 22:45:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D3B48288F8 for ; Wed, 10 Apr 2019 22:45:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C7F6928A9B; Wed, 10 Apr 2019 22:45:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 539C528B3C for ; Wed, 10 Apr 2019 22:45:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FtTaPrWqCm65xKwdtIN28d6Lf0gPMsye0qfXT868l7I=; b=r4o8PN/deyj4aS /1mHZCWMhmVMwfdnXJA3bBrDzNoF7hOuwA7QQMszypxZv29maMxP1EJB6kjjRUVQF7LUS672cOg5L MyR/DmWFJA2RrFRkAQQa3tKSq0XhWyrFWDKwDgNIOgTzk7PVubQlE+I6lOL1/6rKRaaAcqHi6lMPV xqWWqQH7aYdM50aHhJzNBao3dEoMUUFJDfn/pMN4JfSdE9Oohj2ISEX952EdQMMSLrviBsgOT4a6G A/VAw/HtaBJP7NeNdGWxZ/N0lw6m5T6m0h8AALBNmGQQ/pI/xovR9f/yKuC3Y19F50eAbOrGO+iHU M2UvIouwlZBhiPGspZ7g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hELy0-0003qC-VZ; Wed, 10 Apr 2019 22:45:16 +0000 Received: from esa4.hgst.iphmx.com ([216.71.154.42]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hELxx-0003nm-QQ for linux-riscv@lists.infradead.org; Wed, 10 Apr 2019 22:45:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1554936313; x=1586472313; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8a9nFQNbKFd3//6jhM9wfTOXLMw/hQ4czkeb+c+UtjE=; b=K1u04Vh6qR6oqD8CYrFlvV+FstrYBRWGqA3qahSfGwAZWDrZidqm9Y/R vWjDSj7JMA4fX4M7d/dJTn9uRrm/9hl23Ilm40MEee0Nv93qT01LLzIhk 0gDn/3P/U5+TVLLsIBGUbOEtzJZD+p64KGKKwcHfYQzhp+T7q6nUg4gyY 0OGkLzYiZmHowSi11P+i13Nc37aM9D3OsuAKbU4zFU4BY7r1dp3U63S4X PdQc7fu4OUI0QcTTM3ztegHRJhwH0lcFnsq5Wa5Zc2A+GPiAv+CVzR+n+ sDIEu+SU0umdnKnJiimJaTBKVYLDBNVebtYL+88fmKaKUdeW9Wn2c36GX A==; X-IronPort-AV: E=Sophos;i="5.60,335,1549900800"; d="scan'208";a="105470409" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 11 Apr 2019 06:45:11 +0800 IronPort-SDR: n5/oWx2S71aj9kI1hE+PSK3/vvH1Jx6/JTRzH/xa19DYpYx7Ld6MJmy+4S3ZODXMCSFOMSOBPp wI/nAnwcnfHFJc06a7HYcEzntFWTLNV9UVDHmPZUuBUSLrDAqEr9b/s4qTdHJ49Elof0XIFqdM aJBkqTn+Mu8uQM4d2umdCZE7p3ySf43A+tvEXbMkCTuMa3Wyf7ms1Tf/9uG04LfYNdvyrFBYwn MAxzVBAArsIPIojac7LDw6wipvGA/0qJiqAQs4PhUoHTX49vRyIi6MNAqZqdOHLI7wS/umWhpZ suTWdwkpGUpxweGuC1ccqV9d Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 10 Apr 2019 15:24:13 -0700 IronPort-SDR: m/18FSUIFv2lEJf2eefSFGl4WdeRvmz0Q9jV/kflxUyi6lCOts3bODYymr211SYu9PuY7EnEkG gCRt+KpD4F/6+c1QJkLWDJPBGvbJvInvvERne/fbhORuResiADleeMy1dzR9KwhmIPCkoOxu5u L4NOkQOFioR4wF6INiDb2Pnp3rmwh0iLnAPuXUGXAMTX+Xk2+vYaxBx0C/aOPBtftQ4u0/m68j GVbxa7tSFTVgC5z+xh8gZ3b4MMPOPjqXoYhFoxYoayrqZAFpb3usg3vIJ6z36Y7/AFACbqV+a7 xlw= Received: from jedi-01.sdcorp.global.sandisk.com (HELO jedi-01.int.fusionio.com) ([10.11.143.218]) by uls-op-cesaip02.wdc.com with ESMTP; 10 Apr 2019 15:45:11 -0700 From: Atish Patra To: linux-kernel@vger.kernel.org Subject: [1/3] x86: Update DEBUG_TLBFLUSH options description. Date: Wed, 10 Apr 2019 15:44:47 -0700 Message-Id: <20190410224449.10877-2-atish.patra@wdc.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190410224449.10877-1-atish.patra@wdc.com> References: <20190410224449.10877-1-atish.patra@wdc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190410_154513_902817_C982C515 X-CRM114-Status: GOOD ( 11.45 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Albert Ou , Anup Patel , Palmer Dabbelt , "maintainer:X86 ARCHITECTURE 32-BIT AND 64-BIT" , Atish Patra , Ingo Molnar , Borislav Petkov , Gary Guo , "H. Peter Anvin" , linux-riscv@lists.infradead.org, Thomas Gleixner , Luc Van Oostenryck Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP CONFIG_DEBUG_TLBFLUSH was added in 'commit 3df3212f9722 ("x86/tlb: add tlb_flushall_shift knob into debugfs")' to support tlb_flushall_shift knob. The knob was removed in 'commit e9f4e0a9fe27 ("x86/mm: Rip out complicated, out-of-date, buggy TLB flushing")'. However, the debug option was never removed from Kconfig. It was reused in commit '9824cf9753ec ("mm: vmstats: tlb flush counters")' but the commit text was never updated accordingly. Update the Kconfig option description as per its current usage. Signed-off-by: Atish Patra Reviewed-by: Palmer Dabbelt --- arch/x86/Kconfig.debug | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug index 15d0fbe27872..c1a48d4ffebb 100644 --- a/arch/x86/Kconfig.debug +++ b/arch/x86/Kconfig.debug @@ -125,21 +125,12 @@ config DOUBLEFAULT hair. config DEBUG_TLBFLUSH - bool "Set upper limit of TLB entries to flush one-by-one" + bool "Save tlb flush statstics to vmstat" depends on DEBUG_KERNEL ---help--- - X86-only for now. - - This option allows the user to tune the amount of TLB entries the - kernel flushes one-by-one instead of doing a full TLB flush. In - certain situations, the former is cheaper. This is controlled by the - tlb_flushall_shift knob under /sys/kernel/debug/x86. If you set it - to -1, the code flushes the whole TLB unconditionally. Otherwise, - for positive values of it, the kernel will use single TLB entry - invalidating instructions according to the following formula: - - flush_entries <= active_tlb_entries / 2^tlb_flushall_shift + Add tlbflush statstics to vmstat. It is really helpful understand tlbflush + performance and behavior. It should be enabled only for debugging purpose. If in doubt, say "N". From patchwork Wed Apr 10 22:44:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atish Patra X-Patchwork-Id: 10894831 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 89A3C186D for ; Wed, 10 Apr 2019 22:45:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6EB5F28A9B for ; Wed, 10 Apr 2019 22:45:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 62DA928C68; Wed, 10 Apr 2019 22:45:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E16AF28C62 for ; Wed, 10 Apr 2019 22:45:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FTmhNIlBINsfPpnChCbtUf4pkFGj5m31z06SWy7Zp9s=; b=Z5AqbosaPGmPbc Lb9QnwggqHXvHGpSBRA6aUTWK3PL49hjrlLvNBHGSDyiBXPwB5+1dqXKmfHyOTFdri2SvBAveendG zpQ/2mSCMBbvLoDwsq+PS/tHAXEyLBh79Onzkkhc9fwiwVIjVNYCBIdEvzUWs0Toa3BXItLK2QELW 2dyokHmbDH8GVIzuELSA9SOhJuLL6Ivu8YyWwxN0QRRxQo/P86XOEElIFoT9BqFVPTtAnmjipf/Mb RW7yjsot/34m4a4m2hjKLjeAASDRxQykqZ6lZSG01fITrkqxYFkqbA+Hj2VJcXZtH6Kis5POKDzcn +SK6I9GP9OejMFt7UUeQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hELy1-0003r4-KB; Wed, 10 Apr 2019 22:45:17 +0000 Received: from esa4.hgst.iphmx.com ([216.71.154.42]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hELxy-0003o3-07 for linux-riscv@lists.infradead.org; Wed, 10 Apr 2019 22:45:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1554936314; x=1586472314; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6yEgNpC7nkfK5Gt64tHVR1TWf8LgYKpoRswHlGybH9k=; b=SOlzL0xUX4N0KZkoyytzNY0QGbku64Z6QZ7WO2nDjo7X5ZuLQNaB3h2D LhKt/pSPf+qA4pgoxzlH6NCDwRtmiXtpdHZxMC9ms2a1GRwrYgfcQ/5YK OF3MtQSOhoENGXhWjmWuTjPu576VkYhE8oJrTy4i+QLqUtAGbeJIaOC5y k8h6loNXvtX92CrX6Ff+pu3x4h2mPispw3nxQTMa0KR6byCtxKABOHX0p ItnbkU1ohdPux0ny1Xidg1QSZzLczdpl6f3FvT9iEzMUtQGGasJ6IuYOt V6Os465TK5s3MXlenPuxlZtJnUDva/s6TF+fDdrbJN8Qdb+ZVQUoJSVBx A==; X-IronPort-AV: E=Sophos;i="5.60,335,1549900800"; d="scan'208";a="105470412" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 11 Apr 2019 06:45:11 +0800 IronPort-SDR: YgkIzSYnuP32tMWLYZqcdG8jDJQ1Coo5TwthhpbJrSAJ1M7JAU79ddJpSY0C7+rmEl07s2QpWF W/iHpxuZ6iG85RNLIm6TdSbvptoK7gq33A4YIAQONWGuzsYhgDafR3OSaFi/b4oDtZs7GizWGx ti1aEHBxjOK2m2kl+36Xlhmp0XM4Izw3AAafl8DVQcKPadMMguxtwvUG2VPjxscT4GjC/OJuUw Eamw0+5YEcQ+Luv8nTD/QMijRHeCg4PLZO4G40d+pSJsq/k3UNmSsYcTME5FQ6AWGrlRMS2AzP IvvOTIcd1HZ9ajjnhqW8Ng/v Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 10 Apr 2019 15:24:14 -0700 IronPort-SDR: P2tizofEJwBlpXqmdmig2RJ0YQsu23QOCnvgmUAG1H9rvnUHED5nQrQKgVeUFCSMXkVPqz1NFe jVls7ismmD3tpCPVsDdnoyEZqRXuR7C9+3hklSCia+lTFejGZIY6Q2TZc+TZk3F3ayZp+sYZL9 cwsesGy1YxUmbyDiHop/skE8vqRZ3kJWRkllwFplbjXgILSGHQWar81YpZhK+vWWucV0XLsM1T qfB+wvJwOeof4gZPbGRNVWLyYP5n1fcfj873zD0K2rvuxAU5c3n5CefKEFwYSgkUKpPyxC6A78 lYk= Received: from jedi-01.sdcorp.global.sandisk.com (HELO jedi-01.int.fusionio.com) ([10.11.143.218]) by uls-op-cesaip02.wdc.com with ESMTP; 10 Apr 2019 15:45:11 -0700 From: Atish Patra To: linux-kernel@vger.kernel.org Subject: [2/3] RISC-V: Update tlb flush counters Date: Wed, 10 Apr 2019 15:44:48 -0700 Message-Id: <20190410224449.10877-3-atish.patra@wdc.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190410224449.10877-1-atish.patra@wdc.com> References: <20190410224449.10877-1-atish.patra@wdc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190410_154514_078595_FEB53153 X-CRM114-Status: GOOD ( 10.86 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Albert Ou , Anup Patel , Palmer Dabbelt , "maintainer:X86 ARCHITECTURE 32-BIT AND 64-BIT" , Atish Patra , Ingo Molnar , Borislav Petkov , Gary Guo , "H. Peter Anvin" , linux-riscv@lists.infradead.org, Thomas Gleixner , Luc Van Oostenryck Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The TLB flush counters under vmstat seems to be very helpful while debugging TLB flush performance in RISC-V. Update the counters in every TLB flush methods respectively. Signed-off-by: Atish Patra --- arch/riscv/include/asm/tlbflush.h | 5 +++++ arch/riscv/mm/tlbflush.c | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/arch/riscv/include/asm/tlbflush.h b/arch/riscv/include/asm/tlbflush.h index 29a780ca232a..19779a083f52 100644 --- a/arch/riscv/include/asm/tlbflush.h +++ b/arch/riscv/include/asm/tlbflush.h @@ -9,6 +9,7 @@ #define _ASM_RISCV_TLBFLUSH_H #include +#include /* * Flush entire local TLB. 'sfence.vma' implicitly fences with the instruction @@ -16,11 +17,13 @@ */ static inline void local_flush_tlb_all(void) { + count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ALL); __asm__ __volatile__ ("sfence.vma" : : : "memory"); } static inline void local_flush_tlb_mm(struct mm_struct *mm) { + count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ALL); /* Flush ASID 0 so that global mappings are not affected */ __asm__ __volatile__ ("sfence.vma x0, %0" : : "r" (0) : "memory"); } @@ -28,6 +31,7 @@ static inline void local_flush_tlb_mm(struct mm_struct *mm) static inline void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long addr) { + count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ONE); __asm__ __volatile__ ("sfence.vma %0, %1" : : "r" (addr), "r" (0) : "memory"); @@ -35,6 +39,7 @@ static inline void local_flush_tlb_page(struct vm_area_struct *vma, static inline void local_flush_tlb_kernel_page(unsigned long addr) { + count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ONE); __asm__ __volatile__ ("sfence.vma %0" : : "r" (addr) : "memory"); } diff --git a/arch/riscv/mm/tlbflush.c b/arch/riscv/mm/tlbflush.c index ceee76f14a0a..8072d7da32bb 100644 --- a/arch/riscv/mm/tlbflush.c +++ b/arch/riscv/mm/tlbflush.c @@ -4,6 +4,8 @@ */ #include +#include +#include #include #define SFENCE_VMA_FLUSH_ALL ((unsigned long) -1) @@ -110,6 +112,7 @@ static void ipi_remote_sfence_vma(void *info) unsigned long size = data->size; unsigned long i; + count_vm_tlb_event(NR_TLB_REMOTE_FLUSH_RECEIVED); if (size == SFENCE_VMA_FLUSH_ALL) { local_flush_tlb_all(); } @@ -129,6 +132,8 @@ static void ipi_remote_sfence_vma_asid(void *info) unsigned long size = data->size; unsigned long i; + count_vm_tlb_event(NR_TLB_REMOTE_FLUSH_RECEIVED); + /* Flush entire MM context */ if (size == SFENCE_VMA_FLUSH_ALL) { __asm__ __volatile__ ("sfence.vma x0, %0" : : "r" (asid) @@ -158,6 +163,13 @@ static void remote_sfence_vma(unsigned long start, unsigned long size) static void remote_sfence_vma_asid(cpumask_t *mask, unsigned long start, unsigned long size, unsigned long asid) { + int cpuid = smp_processor_id(); + + if (cpumask_equal(mask, cpumask_of(cpuid))) + count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ALL); + else + count_vm_tlb_event(NR_TLB_REMOTE_FLUSH); + if (tlbi_ipi) { struct tlbi info = { .start = start, From patchwork Wed Apr 10 22:44:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atish Patra X-Patchwork-Id: 10894833 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5D11A139A for ; Wed, 10 Apr 2019 22:45:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4232D1FFCA for ; Wed, 10 Apr 2019 22:45:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3F10128A9B; Wed, 10 Apr 2019 22:45:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EC92828C68 for ; Wed, 10 Apr 2019 22:45:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3zK+/KQK84jJ6QVXvAtXWaxyotnFtEusEuWHQVpeXgs=; b=kF2dp49maiWZHq yWuUTqPTvlJQc/C2ip0AEE0UOawMiEs9lxIuf5PUv2b6xW5G2JC9+yk+LLdB6sZ6SfIgKwClQUXNW 34M7U/AIWqYkLAw/M3igpcnSnIcjW55yLj8QkywzqhoaqY3bVDFQujO2HrvSfyrNehw6/F/HIlwmi Up3YUYe7feKnOs6BTsJpRvzpOBhW1rZ+8Uydznr5AqcnHKPoxDG7gRGrHthltXOjpsGincDi92yyd Ht1R8tbHCPZHT63cL2olFO3h9Y3aiUIT4dMhgl4FyWM4jctSmQj0MvvTOwt16JzagFYEHl+D99YuR 9ErKegtrdScHpaugVZew==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hELy2-0003sq-Mk; Wed, 10 Apr 2019 22:45:18 +0000 Received: from esa4.hgst.iphmx.com ([216.71.154.42]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hELxz-0003nm-6G for linux-riscv@lists.infradead.org; Wed, 10 Apr 2019 22:45:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1554936315; x=1586472315; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6727VdCc/EPDYJfj5RPHOjXG6b1yki4VRIhepLKeGtA=; b=j9sVNtutWqHEoRf42N4iIexIhY665z/BKKggnZm+Htn3RqRABe633m7U +kesjR3hGw3/7BwicgL8spLIfRPAqxuzSB6l4g1QgVTPmuNfDGcDxGTTa aMCjhhnwjekkVoAMU1QvYQW4ySeJVa5x2LsP3be522HjcESa1TMFp5IW4 fYb3scGKrB1ZAIeq5Kz09KdUJ1xvqSGPq+oLvQ20nZf1hnehR4S+M3szR ner6T3a7Sq6TyrU0VX7eyEPOb9fDh4+FRGJeJzaPhZCWDNaQwPjCt3M7Z 8BKbBcmwG3gK6kVBP1aQ0NFZnwzDBJuvbZiZBbqFbcAXA0+iPEgGQEmMc A==; X-IronPort-AV: E=Sophos;i="5.60,335,1549900800"; d="scan'208";a="105470414" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 11 Apr 2019 06:45:12 +0800 IronPort-SDR: rEs1PznXo7X+XTcB/AeGgADG4Eq3G0H4SZ5vgOaaKWPRN3+F2Pxw3zepj0ln97D6YsQc1niw7K vjaktCP++LEi2xUAG4PD293hg6iIYjmjMIic7/SGcWZJv+DVavFVVGC5GUqHeJtgyeLY2Ounju 7e9jO7uFnNscptnKXGOJ964s8QcH+t3hpR7RTEpuTXWPSyGb5EMLaXMfAWbjv/IgvkQNCOI9r9 cZYlTpvaqMzdHB4OwafV2bU4Y+d5gfHxsR3zVvtWCsaSRwuIEBjPudDopvowM8sIIW/LlVMf14 noZ8WuS8weJrySpEck00IeZj Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 10 Apr 2019 15:24:14 -0700 IronPort-SDR: NXkg6ju7d4Lh0ulI2k5QJZZENFD98F/fotupJh0yskicrEHcAp7YRd9wiDnh/fw6OikcXYXkfg q+f8VoRlWmlLKJP0MfVLgB/+sjvP7k1boRWhHHyfXITa7MqmkOg23r/TolK8Cs3j3n6Hlv7k3F HVWJT7FqVhKCtpvV9oLxAiKoFIOvzrWotOeT8bkl71aLrcmCs73xEw1z3cWgX2NOBoJeg+IQRS 3iEvqR83I9WJiZ1ZlhJDic+lfrExjNRVg0M2bDUH6jrPDhyba+Hc+KGrYeGx8jcWmjqq7HAg00 e+c= Received: from jedi-01.sdcorp.global.sandisk.com (HELO jedi-01.int.fusionio.com) ([10.11.143.218]) by uls-op-cesaip02.wdc.com with ESMTP; 10 Apr 2019 15:45:11 -0700 From: Atish Patra To: linux-kernel@vger.kernel.org Subject: [3/3] RISC-V: Add DEBUG_TLBFLUSH option. Date: Wed, 10 Apr 2019 15:44:49 -0700 Message-Id: <20190410224449.10877-4-atish.patra@wdc.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190410224449.10877-1-atish.patra@wdc.com> References: <20190410224449.10877-1-atish.patra@wdc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190410_154515_279774_2621CECA X-CRM114-Status: UNSURE ( 8.88 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Albert Ou , Anup Patel , Palmer Dabbelt , "maintainer:X86 ARCHITECTURE 32-BIT AND 64-BIT" , Atish Patra , Ingo Molnar , Borislav Petkov , Gary Guo , "H. Peter Anvin" , linux-riscv@lists.infradead.org, Thomas Gleixner , Luc Van Oostenryck Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The TLB flush counters under vmstat seems to be very helpful while debugging TLB flush performance in RISC-V. Add the Kconfig option only for debug kernels. Signed-off-by: Atish Patra --- arch/riscv/Kconfig.debug | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/riscv/Kconfig.debug b/arch/riscv/Kconfig.debug index e69de29bb2d1..6a2d3762aeda 100644 --- a/arch/riscv/Kconfig.debug +++ b/arch/riscv/Kconfig.debug @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: GPL-2.0 + +config DEBUG_TLBFLUSH + bool "Save tlb flush statstics to vmstat" + depends on DEBUG_KERNEL + help + + Add TLB flush statstics to vmstat. It is really helpful understand tlbflush + performance and behavior. It should be enabled only for debugging purpose. + + If in doubt, say "N". +