From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8F199C77B7F for ; Tue, 16 May 2023 08:28:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=F/kiuCWZdPYoADHp/uPVXqhrHZH7rKQvIRHWjdU4aZE=; b=d8RlZ+VoDt2wqO S2BB4zmhWWK0isK0LJcILjFVeN9qE7jPybe0h7/gwUdgnAxUbUfRgEUiRhbA0jdPMzzj0KLSfo6gL FsuOAnHQSfEmgvbyagUT0M7A7zCpsCd0fKCN9pUh1jJ377Nor66UjDwX27y1241zrO2plhoZMRvlq X0oDYUD+aY1Vh6tNyyVVMDHm2aYHCer5NG5x0ov2n2CoUypW9EG8gAL3btuQ4T8iPeOnI7AfKRMbw Ywaoep4HBtU5fTjxnD3mMt2NkpuNr8eQmdKLJ2HfJ70jPTj/cbhIf5HmsVvQV8v3QhK79VZHyaUYJ wPlx27dsUbiNT/cI8jWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pyq2K-004qnZ-0T; Tue, 16 May 2023 08:28:00 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pyq2G-004qll-2r for linux-arm-kernel@lists.infradead.org; Tue, 16 May 2023 08:27:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=OKQ4a+tXa0/qXXguYvdG6Sogi4IalVeR1nXUDOINLjY=; b=BHFwsbwTwcrvgsvEP912RaMDBz ozBvdyYkgc5efqFqhkFOPJIeFTPkXepcZKyBg1rwKt/olwVm/sdbbmWmoL4SLSaQelvT/UGrbuZVt 5iyUSVJjvGobnx/mYAVZNF8AeEnIsJXnBcnKhDpNHWAHauBji5slZWpFkF5iLtEUj0O/rjhsh9RZB ufK3IlqBOy+srXLnxkg5NhSb+cTUm1/62uCI6/5JAums+9hWAsJ8B290iwAATXMefZW29+qjq6VeM 0cVt4xQKO6YUpP7jonXrD6R22GNiMbn3b/tt0eImR+/Zbx0BgiaNSTJ+Hzy25bNht83GLC5t4tgpQ +RVh0ezQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:37336) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pyq2A-0005Mn-EA; Tue, 16 May 2023 09:27:50 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1pyq28-0000eI-DM; Tue, 16 May 2023 09:27:48 +0100 Date: Tue, 16 May 2023 09:27:48 +0100 From: "Russell King (Oracle)" To: Thomas Gleixner Cc: Andrew Morton , linux-mm@kvack.org, Christoph Hellwig , Uladzislau Rezki , Lorenzo Stoakes , Peter Zijlstra , Baoquan He , John Ogness , linux-arm-kernel@lists.infradead.org, Mark Rutland , Marc Zyngier , x86@kernel.org Subject: Re: Excessive TLB flush ranges Message-ID: References: <87a5y5a6kj.ffs@tglx> <87353x9y3l.ffs@tglx> <87zg658fla.ffs@tglx> <87r0rg93z5.ffs@tglx> <87ilcs8zab.ffs@tglx> <87fs7w8z6y.ffs@tglx> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87fs7w8z6y.ffs@tglx> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230516_012756_922180_1AE52934 X-CRM114-Status: GOOD ( 16.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, May 16, 2023 at 10:20:37AM +0200, Thomas Gleixner wrote: > On Tue, May 16 2023 at 10:18, Thomas Gleixner wrote: > > > On Tue, May 16 2023 at 08:37, Thomas Gleixner wrote: > >> On Mon, May 15 2023 at 22:31, Russell King wrote: > >>>> + list_for_each_entry(va, list, list) { > >>>> + /* flush range by one by one 'invlpg' */ > >>>> + for (addr = va->va_start; addr < va->va_end; addr += PAGE_SIZE) > >>>> + flush_tlb_one_kernel(addr); > >>> > >>> Isn't this just the same as: > >>> flush_tlb_kernel_range(va->va_start, va->va_end); > >> > >> Indeed. > > > > Actually not. At least not on x86 where it'd end up with 3 IPIs for that > > case again, instead of having one which walks the list on each CPU. > > ARM32 has the same problem when tlb_ops_need_broadcast() is true. If tlb_ops_need_broadcast() is true, then isn't it one IPI to other CPUs to flush the range, and possibly another for the Cortex-A15 erratum? I've no idea what flush_tlb_one_kernel() is. I can find no such implementation, there is flush_tlb_kernel_page() though, which I think is what you're referring to above. On ARM32, that will issue one IPI each time it's called, and possibly another IPI for the Cortex-A15 erratum. Given that, flush_tlb_kernel_range() is still going to be more efficient on ARM32 when tlb_ops_need_broadcast() is true than doing it page by page. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel