Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp10973661rwd; Thu, 22 Jun 2023 07:14:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5EellZnS0wGHde0ZgU4afQNjph1TelcRIRTtxrdr+Yd5lVlU3dnKuJt1TEqtYlpc0S0fqp X-Received: by 2002:a92:c0cf:0:b0:340:5b1e:1de9 with SMTP id t15-20020a92c0cf000000b003405b1e1de9mr13019296ilf.3.1687443286690; Thu, 22 Jun 2023 07:14:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687443286; cv=none; d=google.com; s=arc-20160816; b=ZcG17987ufweqiok6XxdRLsnkAx2fcJQ29fzAUyBcFQnyooG4CcsNQfXfrzNAjHyWQ Rvj0pQoZKnfvZisPi/jQIMzHnjG/7a1MZTNcJ4P5esKIbPIgRB8zD8hOFMzJZiAyvk3m 7p3sDWDnFKcVvhawHJn2kfKzI0lGtWaVKTWuvejRh7m/T71XAKfQctM/hrIT+a8tTIJr tuBNaLzUXswxIpLjQwHakvqzR+EqUn6k+tJXqGU1zCnV0EaLfwCCEG67qDBJF2Oj/tCH VEUkDnIG57118Aczyf3DIyHg0aPFnUGCjHOCrbsamZhRaqagDZieF62cP+JJgQY0tv2T FUjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=9GM+KaVBTG0d2ZoawOpQPP3iTozMv6kRahCWZiyW/ao=; b=dESIAH5QJDaSIaot4RKCOC9xuIuADbEUSqhzDBGCPjezf5r7d2/LD1mZBqZMvoF+9m ZZX4nGt4Pkte4/cuTrK9p7eF7FLHT+yWbSoO9E2v13mfvjBd18n5vYbAmk8OVzEPS+Nq PU9ALT9E3bCZ2QXI6uGWTHg4XL699nBhrVnBoVnEXqAYMRBwIyXd1yEJq8CBafhluczS 12B7CLUOfXPh4vGpRjrxvF53FF1L2ThE0jSYpk2ZzjaKT1YnhZ3psLX3hK9+bUEfha80 aD80aGnlkxyLFAmtCfizqR8IGtTZpspDtZ2GmudvdBhEEuTnQS9+5vlCoFZDdwHJkzYB v2AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dE63dA3m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s124-20020a632c82000000b005533d6d9ac7si6729275pgs.584.2023.06.22.07.14.34; Thu, 22 Jun 2023 07:14:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dE63dA3m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230324AbjFVN6e (ORCPT + 99 others); Thu, 22 Jun 2023 09:58:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230177AbjFVN6b (ORCPT ); Thu, 22 Jun 2023 09:58:31 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7377F10D2 for ; Thu, 22 Jun 2023 06:57:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687442266; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9GM+KaVBTG0d2ZoawOpQPP3iTozMv6kRahCWZiyW/ao=; b=dE63dA3mj9ln5+tXWsIQXmlaizNsyy0fLjor2NKmEQWZSNTzQP/DpTfWoWKzXEbX3znGt0 0iFpj78wJtWj1N/KcuDNjdv2UBTRdbt2UcPte3uvGfsIjxDBFxh3muvqvqPgM4WITdDv52 BzJwOiQDPWHS2reYwxJDI9Ti9DAcujQ= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-637-zjeuhj9CN5q78J-s_zYaGw-1; Thu, 22 Jun 2023 09:57:44 -0400 X-MC-Unique: zjeuhj9CN5q78J-s_zYaGw-1 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-3f9b5cc7298so16306595e9.3 for ; Thu, 22 Jun 2023 06:57:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687442263; x=1690034263; h=content-transfer-encoding:mime-version:references:in-reply-to:date :cc:to:from:subject:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=9GM+KaVBTG0d2ZoawOpQPP3iTozMv6kRahCWZiyW/ao=; b=hKV4jqXez95LowuNMdXUlhLoi1LWigFbym6qqPIZDbMXVSnvZzZadUPH4G0O/ILTJj e5u8UtfHh6Wa2wje/V2sZh3Z/qHr7LPP8fc5zTQi/+wBRB40UMlFf3yp4C+vcNbtbhVF n7w0nP7lO0VDiZuT06eRpxcIxEZ1JVuXSGoskj8syAIH47cj2f3td7IePruEXYNKh3yK eSMaiBt1KSieQiX/jmGmi79n2f7sqLoZeK9Yysok3ixSb55Y5TRYdPf0xp393wSS6sfO l546/f4lyNe2Eur3cP8yRSvmk09MAIQZyOmLlmelSnsDaJDsmqghE09UhUGQjHYyFk6E yMoA== X-Gm-Message-State: AC+VfDw7mz0VbZ6+yGd6e9VNueXrmdCgIvGSHmgyDn8MPheURQDbi/j1 aCqfVeaAMeOiIcAxMCeP6oS7YIEBOaPvvRU65ESvAkOGA5Ar1c5Tb8CWJCA+T8wVaNddXuewfZs SXEcUFfN2uwZkDu7y7ZSD0FkU X-Received: by 2002:a05:600c:2942:b0:3f7:5d:4a06 with SMTP id n2-20020a05600c294200b003f7005d4a06mr1531917wmd.1.1687442263390; Thu, 22 Jun 2023 06:57:43 -0700 (PDT) X-Received: by 2002:a05:600c:2942:b0:3f7:5d:4a06 with SMTP id n2-20020a05600c294200b003f7005d4a06mr1531890wmd.1.1687442263118; Thu, 22 Jun 2023 06:57:43 -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 n6-20020a7bcbc6000000b003f7e4d143cfsm7832711wmi.15.2023.06.22.06.57.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jun 2023 06:57:42 -0700 (PDT) Message-ID: 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: Nadav Amit Cc: mtosatti@redhat.com, ppandit@redhat.com, David Hildenbrand , "Russell King (Oracle)" , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Heiko Carstens , gor@linux.ibm.com, agordeev@linux.ibm.com, Christian Borntraeger , svens@linux.ibm.com, "David S. Miller" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Kees Cook , "Paul E. McKenney" , frederic@kernel.org, Will Deacon , Peter Zijlstra , ardb@kernel.org, samitolvanen@google.com, juerg.haefliger@canonical.com, Arnd Bergmann , rmk+kernel@armlinux.org.uk, geert+renesas@glider.be, linus.walleij@linaro.org, Andrew Morton , sebastian.reichel@collabora.com, Mike Rapoport , aneesh.kumar@linux.ibm.com, the arch/x86 maintainers , linux-arm-kernel@lists.infradead.org, linuxppc-dev , linux-s390 , sparclinux@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm , linux-kernel@vger.kernel.org Date: Thu, 22 Jun 2023 16:57:39 +0300 In-Reply-To: <10050BB1-15A4-4E84-B900-B21500B2079B@gmail.com> References: <20230620144618.125703-1-ypodemsk@redhat.com> <20230620144618.125703-3-ypodemsk@redhat.com> <10050BB1-15A4-4E84-B900-B21500B2079B@gmail.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-22.el8) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2023-06-21 at 11:02 -0700, Nadav Amit wrote: > > On Jun 20, 2023, at 7:46 AM, Yair Podemsky > > wrote: > > > > @@ -1525,7 +1525,7 @@ static void collapse_and_free_pmd(struct > > mm_struct *mm, struct vm_area_struct *v > > addr + HPAGE_PMD_SIZE); > > mmu_notifier_invalidate_range_start(&range); > > pmd = pmdp_collapse_flush(vma, addr, pmdp); > > - tlb_remove_table_sync_one(); > > + tlb_remove_table_sync_one(mm); > > Can’t pmdp_collapse_flush() have one additional argument > “freed_tables” > that it would propagate, for instance on x86 to flush_tlb_mm_range() > ? > Then you would not need tlb_remove_table_sync_one() to issue an > additional > IPI, no? > > It just seems that you might still have 2 IPIs in many cases instead > of > one, and unless I am missing something, I don’t see why. > Hi Nadav, Thanks for your comment. I think you are right and in some configurations 2 IPIs might occur. However I a am not really dealing with the thp code at the moment, This patch is about the mmu_gatherer and mostly dealing with IPIs sent via the other code path. Thanks, Yair