Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp628975ybl; Thu, 22 Aug 2019 02:22:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqxHXCKdRS6BJGgXasWSu5iBB6lMBCsGPeh0Qh8TfCzUgisI3t1qUld8A2tYoQo4Pp40p1j9 X-Received: by 2002:aa7:968d:: with SMTP id f13mr41285387pfk.223.1566465728807; Thu, 22 Aug 2019 02:22:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566465728; cv=none; d=google.com; s=arc-20160816; b=XpIHG2tW6pBX/ynIVtAw9r9xzzwTOIn2j4a9Ho1bIR4016ZyqwGoBz/SAV6TYZhHEC wvu1+crlH9hvh0+ydus1H4cnd97ppBtuKJXpaCo0hDnILBTrqTze1eXDel0AdgmjaaQY IDq2Za4US7Piney2QrpZR6Uy9dClroaZr/Mgm0Q0iGrAQvs2FA5SKXnOzS8XpPJNK9y9 QACaAD8M2pF7bLrYtP7jTWeDnY6ebaO3cVQEhYv37zTvLKY79xj8jAqvEACJnfn7WKGW +WOoFNYZvde9dG4PbzYY9xTt68He5fng0oMZxkRMSipqcETl2FUEhxykgKUB/HVYAkAZ 9rOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :wdcironportexception:ironport-sdr:ironport-sdr:ironport-sdr :dkim-signature; bh=5dw0kIZ3QHANCJ6ud2coZdqkWW3F78APnpgP2j+QDiY=; b=YIDcWexb6ZKnIpRvXOdM9bFVxDU9F8j5+nyc4V6aPcZfxRyslWasA9Wo8qerz9Dwuo FmVsSyLDNYhfTrSF2Au9CmYthirBymxbXKxZsmUiEUExK5QGqCqzQAooQ9k3Nv2zBsni 0yb/QoUHQv0cjy3AAmligtRKnRGUxE6d7yyozZgSGbNxbuYvxH4mndylmq4dTKepdQx9 lx8MBhYnWQVK8F5ytLOLX1cRhDnLsjM8SNa9Oq8X+kX/8uGS1QqgafawOXa0IyXCZWQU u6qlrRHYfkguOEmg/oZNvtt51MZcMKtQ1yGEJDAu5/F6GxVm2iVh2Tkvs2145P3rVlpg ehtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=IE9V3zAU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r4si16370558pgi.304.2019.08.22.02.21.53; Thu, 22 Aug 2019 02:22:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=IE9V3zAU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731823AbfHVH7A (ORCPT + 99 others); Thu, 22 Aug 2019 03:59:00 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:20003 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730431AbfHVH67 (ORCPT ); Thu, 22 Aug 2019 03:58:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1566460740; x=1597996740; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zMgrwQo3ioYoX5CQO1W5apOPVVHZ8O/Xw2bhvtHvfOw=; b=IE9V3zAURPI/mVnJ1sUct3ATBTOGZxJr24cA3cnV6DQD121JhXzrY7bG dsYnvkN3UbU8+FnNeRZUOsJZjXxOuV6Jpo/ocyUNfbPq2vMDv1Ky/hY0/ HZnlcf+HYEIDM7U9J4/+AwNfmf0a9/S1XMVJkjcqae5G1WxGneVN8yNbS 1FiB591PHFBr8D12bPqaITTTxfMbVtjRM1sR4Dm7uJyK7oZDZtAIfeysE bZo7eWcUNHJlSjtcy0NrBqpr1bl/CkhXJp66vuwFBFV5ZfnUzX5sL0kId aI9XDKGWpC6uvMBggMB2DbNFdiGBWToZ9OiHqhglyBPxCaX9et+2Q06fy A==; IronPort-SDR: HoU518b1x4zmaa6VN+71c4unrRg0Vl7FfQFLPSX2Kgycl1uDckKqYckl6QStdm7mxD9PGXfNeq EIf8topBLfb3rpBUI6a8HIW0E9T7i4I0J2S9ktOGkcIRQM6ZdroiBZ0BRGVIK/aiVF89FA8XcP qWYJBfxuPQdU0diSBMWiDarDvDjZnj1z3NYbD0haTfTl4n3Mo8CUBfGmCwAZU5hpaEAZp/oDFs xa+shTw8KLOqNqMU5MnjjB2z73WWyyMuRXtJt4KK77fFpToJrMbGkYtE6LTW5hgj3rMgp07vYk NEs= X-IronPort-AV: E=Sophos;i="5.64,415,1559491200"; d="scan'208";a="116397485" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 22 Aug 2019 15:58:59 +0800 IronPort-SDR: XO2D3Pvo3sOykbykkGFoRvsUJAqHOyQU9ju7JA+Eur22Zk/69g7tNOXarEIVLOu/Em2ec/LEGE X+yGd9LGfEJeJ4w9uSA3ioROCoSeMauRATNicJwOr8Xb1OwU+ybjPkivjuFb/TIJNALt8PecI7 qS97DTh6nDr5qXNoiRdlbEi94xwoLyU/FSgpkWP/MLq9pdUl0H7mce/j5EAx8TqyFbZTxVgpY+ 2wiZa7GKuxJ+aVvlDabu3PjT7oHsRN0URZKpdTanWl87LitGvV5SxhNV1evsccEBiVk+rP7JPc ZKIiIAxJtcKgrz43nBte5fxL Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Aug 2019 00:56:19 -0700 IronPort-SDR: 7VJp5AX1m3dQMbgrglO08YJQbJAypaQXuQTfTNHQ3OB2+NiU57sfGAMfxX/aL2VOobx6ltblnx LktuVXVYN25WuohHaGZgbFHpzHBTIBkAER1BV5wVs7vtyLXxeGXzwobK/aDtd+1AXCl4bBByj8 s/niCGcIiy4ZSwPKQLi7THnQrriAEe/6k1/YEV7A4c9LCcHQBB74I1s8jZcxTTZD4udB2oVhw1 9Tfo8Ai5rcFo8yWnWPhXzGi8hMGGxcTyc4/qj4d+/v6bs3XmBI/YlGP/JtneDHWSNlgx/R9R3M Coc= WDCIronportException: Internal 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; 22 Aug 2019 00:58:59 -0700 From: Atish Patra To: linux-kernel@vger.kernel.org Cc: Atish Patra , Albert Ou , linux-riscv@lists.infradead.org, Palmer Dabbelt , Paul Walmsley , Christoph Hellwig , Anup Patel Subject: [PATCH v4 3/3] RISC-V: Issue a tlb page flush if possible Date: Thu, 22 Aug 2019 00:51:51 -0700 Message-Id: <20190822075151.24838-4-atish.patra@wdc.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190822075151.24838-1-atish.patra@wdc.com> References: <20190822075151.24838-1-atish.patra@wdc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If tlbflush request is for page only, there is no need to do a complete local tlb shootdown. Just do a local tlb flush for the given address. Signed-off-by: Atish Patra --- arch/riscv/mm/tlbflush.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/riscv/mm/tlbflush.c b/arch/riscv/mm/tlbflush.c index 8172fbf46123..b1c04751bcf1 100644 --- a/arch/riscv/mm/tlbflush.c +++ b/arch/riscv/mm/tlbflush.c @@ -27,7 +27,10 @@ static void __sbi_tlb_flush_range(struct cpumask *cmask, unsigned long start, if (cpumask_any_but(cmask, cpuid) >= nr_cpu_ids) { /* local cpu is the only cpu present in cpumask */ - local_flush_tlb_all(); + if (size <= PAGE_SIZE) + local_flush_tlb_page(start); + else + local_flush_tlb_all(); } else { riscv_cpuid_to_hartid_mask(cmask, &hmask); sbi_remote_sfence_vma(cpumask_bits(&hmask), start, size); -- 2.21.0