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 6EF88EB64D8 for ; Thu, 22 Jun 2023 14:15:46 +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:Mime-Version:References:In-Reply-To: Date:To:From:Subject:Message-ID:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CTetZXKbbu5KS6jOn5Qet8mxZWJEuqufGeiebcd0p8U=; b=s3ElcfdlHZ0E2X MoWpzOWDWP8/hYLdOLmnYwZjhklTI7XQSXqQLHn5RM/o1ud97O82MvZfhgxm1qeHHxxvDWfYsXEFO 7mKrwSK5IB/bYEZUzjU9PcK1dR9PNVWcCTf/ypSkcksYY774yUt6V15X2JzdmyJ52dJnYs0WCswwf tKTVZkgVsmElhWoZ8J4YQzM7uGyvLarEGIGiuSSkFi/0LvOZC4tQcqnq0/hJFMNnAPGjiF6TT+/uz 0UTmDzwpENs74rrhKVqBaJ+cMUH2bIo90Ko1GwNix9DyljSWxAK9v7a5f7H7ZrPNlaT/iru95RyWa fFe4jSuaAsozIM/GsqgA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qCL66-000wI0-0r; Thu, 22 Jun 2023 14:15:42 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qCK9T-000k2F-1E for linux-arm-kernel@lists.infradead.org; Thu, 22 Jun 2023 13:15:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687439706; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CwNoD4npTXJHndQ39H5OyokG0A2tJC7uKm6DdKDHg0U=; b=evb6L7fqXXI1JFwxJeksKZmnQRliHHIUCssVoEFYKsXdgq/t3QwHL+Ix4dLZqVmbgr6K/B xGNSj8isN3Nf+2LnVA/S1P6IROLtY00YZNMBow7KAv2FbiLV3OynRpcICiVrBLOq2MmSr8 RwnE44g6TSEeaELmM93C+OIR0esh+lM= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-501-GR6lRCvHMjGgRER2KF_phg-1; Thu, 22 Jun 2023 09:15:05 -0400 X-MC-Unique: GR6lRCvHMjGgRER2KF_phg-1 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-3f814f78af2so33156225e9.0 for ; Thu, 22 Jun 2023 06:15:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687439703; x=1690031703; h=content-transfer-encoding:mime-version:references:in-reply-to:date :to:from:subject:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=CwNoD4npTXJHndQ39H5OyokG0A2tJC7uKm6DdKDHg0U=; b=hfr6qe0R/8plGJEGn5pbt4Ooft1k6IJw5QmPEo9wjB2QJqciTcVJMx1eff2PONiDTN A//BF1ARMUdyN3k5qxKXb/lBtuj269sNb4Dbd+ktQP7nWeMr67EbjjGkt4SdR7H9KQBb l5iDn+7Suj/7fweBO6cLz161lM+ztES4bJlu60OF8Lo/qo0PkMFdplLIwFwLP56C7WFX eiwG/dv/El4c9fADcVrIn/DvtvBsTz5FDR/9P0+iG53hHyU9Qlt4CmnqzHwyLqLYOjfm KqfsIZ6tL7mPhf8XPDAqGO0Dk9cYWBOeF6pF3LcA5PRipDeUkrFSO8IgM0EQ6cgFC1BR Zm9g== X-Gm-Message-State: AC+VfDxhLCTtXADtLn4p4TBo2uRhVJTyKPuXm3EKQq+yf0AXzj1wwn58 RLeLHJ8Z2KHmPFV4hRFUg4DNKIwTBwlllMoY0V1bE37FLy7SJkU814BlPr6cqCVSHr6a5vMmhsT LjAx0hSayodG7WsHwmz7W2u8nviSllTdGNas= X-Received: by 2002:adf:fa83:0:b0:30e:56ae:ccb7 with SMTP id h3-20020adffa83000000b0030e56aeccb7mr13129198wrr.52.1687439702991; Thu, 22 Jun 2023 06:15:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7wzrlESkKHfrkXueFgu575m1EZWaFeye+ZamuL5DG2JBkgkpwqxiajJqPMAdS7wlgFKQpT2g== X-Received: by 2002:adf:fa83:0:b0:30e:56ae:ccb7 with SMTP id h3-20020adffa83000000b0030e56aeccb7mr13129176wrr.52.1687439702720; Thu, 22 Jun 2023 06:15:02 -0700 (PDT) Received: from ypodemsk.tlv.csb (IGLD-84-229-250-192.inter.net.il. [84.229.250.192]) by smtp.gmail.com with ESMTPSA id u6-20020adff886000000b0031130b9b173sm7014116wrp.34.2023.06.22.06.14.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jun 2023 06:15:02 -0700 (PDT) Message-ID: <79f29f99fa07c46dbaee7b802cdd7b477b2d8dd1.camel@redhat.com> Subject: Re: [PATCH v2 2/2] mm/mmu_gather: send tlb_remove_table_smp_sync IPI only to MM CPUs From: ypodemsk@redhat.com To: Dave Hansen , mtosatti@redhat.com, ppandit@redhat.com, david@redhat.com, linux@armlinux.org.uk, mpe@ellerman.id.au, npiggin@gmail.com, christophe.leroy@csgroup.eu, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, davem@davemloft.net, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, keescook@chromium.org, paulmck@kernel.org, frederic@kernel.org, will@kernel.org, peterz@infradead.org, ardb@kernel.org, samitolvanen@google.com, juerg.haefliger@canonical.com, arnd@arndb.de, rmk+kernel@armlinux.org.uk, geert+renesas@glider.be, linus.walleij@linaro.org, akpm@linux-foundation.org, sebastian.reichel@collabora.com, rppt@kernel.org, aneesh.kumar@linux.ibm.com, x86@kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Date: Thu, 22 Jun 2023 16:14:58 +0300 In-Reply-To: <680fadba-9104-3914-5175-e207fd3d9246@intel.com> References: <20230620144618.125703-1-ypodemsk@redhat.com> <20230620144618.125703-3-ypodemsk@redhat.com> <680fadba-9104-3914-5175-e207fd3d9246@intel.com> X-Mailer: Evolution 3.28.5 (3.28.5-22.el8) Mime-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230622_061507_519874_9EA6EBBC X-CRM114-Status: GOOD ( 21.08 ) 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 Wed, 2023-06-21 at 10:42 -0700, Dave Hansen wrote: > On 6/20/23 07:46, Yair Podemsky wrote: > > -void tlb_remove_table_sync_one(void) > > +#ifdef CONFIG_ARCH_HAS_CPUMASK_BITS > > +#define REMOVE_TABLE_IPI_MASK mm_cpumask(mm) > > +#else > > +#define REMOVE_TABLE_IPI_MASK cpu_online_mask > > +#endif /* CONFIG_ARCH_HAS_CPUMASK_BITS */ > > + > > +void tlb_remove_table_sync_one(struct mm_struct *mm) > > { > > /* > > * This isn't an RCU grace period and hence the page-tables > > cannot be > > @@ -200,7 +206,8 @@ void tlb_remove_table_sync_one(void) > > * It is however sufficient for software page-table walkers > > that rely on > > * IRQ disabling. > > */ > > - smp_call_function(tlb_remove_table_smp_sync, NULL, 1); > > + on_each_cpu_mask(REMOVE_TABLE_IPI_MASK, > > tlb_remove_table_smp_sync, > > + NULL, true); > > } > > That "REMOVE_TABLE_IPI_MASK" thing is pretty confusing. It *looks* > like > a constant. It does *NOT* look at all like it consumes 'mm'. Worst > case, just create a local variable: > > if (IS_ENABLED(CONFIG_ARCH_HAS_CPUMASK_BITS)) > ipi_mask = mm_cpumask(mm); > else > ipi_mask = cpu_online_mask; > > on_each_cpu_mask(ipi_mask, ...); > > That's a billion times more clear and it'll compile down to the same > thing. > > I do think the CONFIG_ARCH_HAS_CPUMASK_BITS naming is also pretty > confusing, but I don't have any better suggestions. Maybe something > with "MM_CPUMASK" in it? > Hi Dave, Thanks for your suggestions! I will send a new version with the local variable as you suggested soon. As for the config name, what about CONFIG_ARCH_HAS_MM_CPUMASK? Thanks, Yair _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel