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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C36BEB64D8 for ; Thu, 22 Jun 2023 13:58:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231147AbjFVN6f (ORCPT ); Thu, 22 Jun 2023 09:58:35 -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-Google-Smtp-Source: ACHHUZ5p9/Up90QSZ1DAdrQMEuugJHQR/5D9norGZu6r3B4czFVgo4n6RIoxrIJViM7m10t9Bv6d/Q== 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 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