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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E50EDC43334 for ; Fri, 8 Jul 2022 13:25:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 20EB96B0072; Fri, 8 Jul 2022 09:25:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1BEC86B0073; Fri, 8 Jul 2022 09:25:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 087FA6B0074; Fri, 8 Jul 2022 09:25:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id EB5976B0072 for ; Fri, 8 Jul 2022 09:25:48 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id B647660993 for ; Fri, 8 Jul 2022 13:25:48 +0000 (UTC) X-FDA: 79664005176.21.DBF7F0B Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf01.hostedemail.com (Postfix) with ESMTP id 58AA74001D for ; Fri, 8 Jul 2022 13:25:48 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 79E8662766; Fri, 8 Jul 2022 13:25:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA5D7C341C0; Fri, 8 Jul 2022 13:25:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657286746; bh=kiYtT9hLbePp8EtNY1UwK72n5vdCDWiZ8WtLVxJxT/M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=I9T9CVanXbnEkJJWhVJ9/oh217Xres+SPcuCsPe40J/JFlit80JgfOc/Hl4lSZPVE FSTR2G/7gstEa9PXYeABJD3HcXBI574rehwu4g89dWId7MNJq62cRnhEbuh3IG5BZH YL1LZQOpUIvJjbtIzxtrCUKdHQCbX85QS6mb80RcaKSHawqNlJ/RuWS82uU2OzPsE8 iCu4Yh5IkbAzUcXzjgpvoL+MP4d3PJlrPVHocOjNZSbJABFdVqOu1hRKx6PrBbFX/m erqkv+EVm/eQos0EcMdvrCIiftsH6Kq2e8P76w/Tidut3Q6yqsoUbWiZX9nlhzzmwQ +nebJaIlE49dg== Date: Fri, 8 Jul 2022 14:25:40 +0100 From: Will Deacon To: Peter Zijlstra Cc: Jann Horn , Linus Torvalds , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Dave Airlie , Daniel Vetter , Andrew Morton , Guo Ren , David Miller Subject: Re: [PATCH 1/4] mmu_gather: Remove per arch tlb_{start,end}_vma() Message-ID: <20220708132539.GA5989@willie-the-truck> References: <20220708071802.751003711@infradead.org> <20220708071833.955178793@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220708071833.955178793@infradead.org> User-Agent: Mutt/1.10.1 (2018-07-13) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657286748; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=/3Qykv+oa2HhQPOZQKNfx8Pt0vx3Tf9hKNlnYZIJ8fc=; b=j9+aSQB4BC7+j4eh6daC28AaOPNv4OAs4IEm+cXqLHBZxwKmt5ttHlldoEcj+3ZdrsjEhg AmWnWB6Y5JYjvMRqe2O4v9PWlDTuIQd4sNW2dZwXBJs71Y0eXstPIJocCFP89fk1f9EtYj G3EBdkDXK0y979IfnziYGu0Ian1ONNA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657286748; a=rsa-sha256; cv=none; b=ZQLbuar35hGks0RvXuMxwBHlouzoAjhje9xyer6mp+pnNzBNO/QFh/abcXW3DLtxdWSVr4 EBFub8Dygb3tqWwksCJmWOU9LXUAMhCQdytcQEu9IZ1/1FARRuqFd0UaKgDY41SOdR57lH VRWiWleDgde1aFGwRosg1FGNjzIN7xk= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=I9T9CVan; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf01.hostedemail.com: domain of will@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=will@kernel.org X-Stat-Signature: zphr4c4utp3yi5aapu6hpu4fq99sw9ns X-Rspamd-Queue-Id: 58AA74001D Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=I9T9CVan; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf01.hostedemail.com: domain of will@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=will@kernel.org X-Rspam-User: X-Rspamd-Server: rspam05 X-HE-Tag: 1657286748-338600 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Jul 08, 2022 at 09:18:03AM +0200, Peter Zijlstra wrote: > Scattered across the archs are 3 basic forms of tlb_{start,end}_vma(). > Provide two new MMU_GATHER_knobs to enumerate them and remove the per > arch tlb_{start,end}_vma() implementations. > > - MMU_GATHER_NO_FLUSH_CACHE indicates the arch has flush_cache_range() > but does *NOT* want to call it for each VMA. > > - MMU_GATHER_MERGE_VMAS indicates the arch wants to merge the > invalidate across multiple VMAs if possible. > > With these it is possible to capture the three forms: > > 1) empty stubs; > select MMU_GATHER_NO_FLUSH_CACHE and MMU_GATHER_MERGE_VMAS > > 2) start: flush_cache_range(), end: empty; > select MMU_GATHER_MERGE_VMAS > > 3) start: flush_cache_range(), end: flush_tlb_range(); > default > > Obviously, if the architecture does not have flush_cache_range() then > it also doesn't need to select MMU_GATHER_NO_FLUSH_CACHE. > > Signed-off-by: Peter Zijlstra (Intel) > --- > arch/Kconfig | 7 +++++++ > arch/csky/include/asm/tlb.h | 13 ------------- > arch/loongarch/Kconfig | 1 + > arch/loongarch/include/asm/tlb.h | 10 ---------- > arch/powerpc/Kconfig | 1 + > arch/powerpc/include/asm/tlb.h | 2 -- > arch/s390/Kconfig | 1 + > arch/s390/include/asm/tlb.h | 3 --- > arch/sparc/Kconfig | 2 ++ > arch/sparc/include/asm/tlb_64.h | 2 -- > arch/x86/Kconfig | 1 + > arch/x86/include/asm/tlb.h | 3 --- > include/asm-generic/tlb.h | 21 +++++++++++++++++++-- > 13 files changed, 32 insertions(+), 35 deletions(-) > > --- a/arch/Kconfig > +++ b/arch/Kconfig > @@ -438,6 +438,13 @@ config MMU_GATHER_PAGE_SIZE > > config MMU_GATHER_NO_RANGE > bool > + select MMU_GATHER_MERGE_VMAS > + > +config MMU_GATHER_NO_FLUSH_CACHE > + bool If this is really a sparc-special and we don't necessarily want it to proliferate, then maybe: default y depends on SPARC would keep it confined? But I don't mind either way and the important bits of the patch look good: Acked-by: Will Deacon Thanks, Will