Received: by 10.223.176.46 with SMTP id f43csp4164304wra; Tue, 23 Jan 2018 05:24:02 -0800 (PST) X-Google-Smtp-Source: AH8x227hTel/4Cw2y3fXUU87C15qIBACe+Qet8Id2yP8qsG9X+f/uMtMYh0otCodQEZRWawBr3X4 X-Received: by 2002:a17:902:7003:: with SMTP id y3-v6mr5653916plk.449.1516713842263; Tue, 23 Jan 2018 05:24:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516713842; cv=none; d=google.com; s=arc-20160816; b=b8R5vhsB2bYT0CY8WeickzF+KI0wXzsZzlX25km9CbSZk6CW0g1AXuBG7KOu/+RkNt rC/Ua9ZY6EHhQpH3DtKRjuBxs1/vMdGBmmsBTeOniCA1KN7l/fbwYW9Y6ENYv/HpS3Q2 og+xw/hL53OJA8x0R0KMOx+5aqcJySdVcl/KqZ+3o7ybl36blFzL2au3XWvuRVqgS4lN 1HTn4U35sVfI3qrL6mHoXOp6bovqY5jvRsHUEJgADvdl9ppBpCIGT+lpKMhT8HuVml/y QgMJCEevVtnQqaBIutFP35WI2/eVE9aMvXNWtYjOy8SzSbAFFNW4pBspDHiFhSpNekvA lqrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:cc:to:subject:from :arc-authentication-results; bh=L3dgxm5RV/Q/R15eSHzc0xVnU+07pEm/EZN8tCsvrV8=; b=yjLLfl8F5YPqSKr4MSlu11HQ4dwUuUWBwU9ZFCJqaiz1mWGDXM90HOt53tpIgrce3a 7NIVTPqGRbqQGHfSyls05ApS8wsYmPy9i40HCvXSPLbqvJsI04tU13WCCdMRECJ8viuK +2Ma6Wd2yyUeBQU70E3DzdTyt6rzmcAfJHX3Mo53wFPCYH4iQYCszqOIexngUBe5IgiU QP3OUtu9k9VO3yIr0Fc341mjdsJyaQuZIzCJ4ytyzUKbE6EIs+BW7Yix0mDzAw23OBLn bstJKAasByIVP71qJz676gvHgcE01iPuencTxrb5skkTIkAJxHzu32NRWKMCbB3ikMaP Vx9Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t4si14280911pgr.205.2018.01.23.05.23.47; Tue, 23 Jan 2018 05:24:02 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752471AbeAWNW5 (ORCPT + 99 others); Tue, 23 Jan 2018 08:22:57 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:15744 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752178AbeAWNWx (ORCPT ); Tue, 23 Jan 2018 08:22:53 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 3zQprL5lPHz9ttpF; Tue, 23 Jan 2018 14:22:42 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id 2vVGKj4O_s_r; Tue, 23 Jan 2018 14:22:42 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 3zQprL50plz9ttpB; Tue, 23 Jan 2018 14:22:42 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 19BE08B95B; Tue, 23 Jan 2018 14:22:51 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id oGDHaBXiaPyz; Tue, 23 Jan 2018 14:22:51 +0100 (CET) Received: from PO15451.localdomain (po15451.idsi0.si.c-s.fr [172.25.231.40]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 91E5E8B95F; Tue, 23 Jan 2018 14:22:50 +0100 (CET) Received: by localhost.localdomain (Postfix, from userid 0) id 4A2BD6EF69; Tue, 23 Jan 2018 14:22:50 +0100 (CET) From: Christophe Leroy Subject: [PATCH] powerpc/mm/nohash: do not flush the entire mm when range is a single page To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Scott Wood Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Message-Id: <20180123132250.4A2BD6EF69@localhost.localdomain> Date: Tue, 23 Jan 2018 14:22:50 +0100 (CET) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Most of the time, flush_tlb_range() is called on single pages. At the time being, flush_tlb_range() inconditionnaly calls flush_tlb_mm() which flushes at least the entire PID pages and on older CPUs like 4xx or 8xx it flushes the entire TLB table. This patch calls flush_tlb_page() instead of flush_tlb_mm() when the range is a single page. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/tlb_nohash.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/mm/tlb_nohash.c b/arch/powerpc/mm/tlb_nohash.c index bfc4a0869609..15fe5f0c8665 100644 --- a/arch/powerpc/mm/tlb_nohash.c +++ b/arch/powerpc/mm/tlb_nohash.c @@ -388,7 +388,10 @@ void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, unsigned long end) { - flush_tlb_mm(vma->vm_mm); + if (end - start == PAGE_SIZE && !(start & ~PAGE_MASK)) + flush_tlb_page(vma, start); + else + flush_tlb_mm(vma->vm_mm); } EXPORT_SYMBOL(flush_tlb_range); -- 2.13.3