Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2273230rwl; Thu, 6 Apr 2023 08:04:47 -0700 (PDT) X-Google-Smtp-Source: AKy350Zqxdlklb1vdTcY1MR5isCrs0rfLw1NvvcJg/isi06GqHwxofRN2UPN+pDSsSXn3oJJbr8B X-Received: by 2002:a05:6402:3586:b0:504:7082:8abe with SMTP id y6-20020a056402358600b0050470828abemr1445374edc.2.1680793487443; Thu, 06 Apr 2023 08:04:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680793487; cv=none; d=google.com; s=arc-20160816; b=xgd8x+s6ef1xHuAx0Gt19DL5axXcb510H7TPEdih3rDvgfMtm5tWF52OTM6iJxOJV2 4Udm2/v5oO2vXXtt/NJFMGvlAPTiI+AbjKTtZ4BaVT4JccLqw0hRcyP24Lq5aoEskJ6m nypHkIx0aPgGXNWbUvknFmQ9fZ2VsnUeKHpXlsk1oBmcz6N/wFAf9tiDEnGapfHiotT/ AS11+Uy5nrouA4H4FrABpH1++B4pQXnhbWxIfEuQHso2lHiHpZPv+dl6zLVPdiAp3Z5j Eaq/kfLPWD0nwMoQ6LqUpK2XMMAFPaxGDLkZyIecg/lNSCE9d5+apoJ0RSmznmRBj2zo gXjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=NvfDt1wEQmP4GbrgT80G40At21xJRS6EHasfhbcOMOE=; b=VY9fVMZKoDblYtKPBiKTDl0KhFIysVh5aVaVlKOChw+nAkRjqxptna7sLCR8IBM+Ci EA8xmdbk6vUOydtzt6zR5O0QySQENcLQyBd6tlUGJ0nkTd9nhnU6DfzVjC0oxXGk6JR1 SA1ebgvba4POTeI1+mbyjT/Ff7UUeOnYUGnT4gjPY4zqGGzrdssFuLa+LZcjvqwd9Khh tydNMTL0y95CBqN7wu6nZIv0ROfHoSLIEPQkvYg6OPd1eGQAgJygT1BKWSjqGxShhDMa VhG0xIsSWauk3k/u39CbFS70iMfj0eiUqToO+TcuZGh2c1ydKyfSyAfDNUQ0iVDhlX9p ucfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=g9HMgChB; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w20-20020a056402071400b005024a8dc728si1298604edx.243.2023.04.06.08.04.01; Thu, 06 Apr 2023 08:04:47 -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=@infradead.org header.s=desiato.20200630 header.b=g9HMgChB; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239534AbjDFPDN (ORCPT + 99 others); Thu, 6 Apr 2023 11:03:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239525AbjDFPDM (ORCPT ); Thu, 6 Apr 2023 11:03:12 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA23D1BCB; Thu, 6 Apr 2023 08:02:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=NvfDt1wEQmP4GbrgT80G40At21xJRS6EHasfhbcOMOE=; b=g9HMgChByDEcqwPRnMmPkqIWgT E9Jo8wK8pTfqUwNGF3RulzK1C+eAF5o0HLXxTCm1aNFPSyeLIz7NBcYvhiL3fWMksBf4GfvKV1nBp R1ktgGzkQffGLNq0EdKUX3JVOd/BZXRVD1HVj5FYNpwkWKn6UfKWr7lyfGZ57eHCE1Ap9OwCdXmRU QFECUvV14SnLI6zo7b+CEQjzYLN1FnZJGuTV5debvwUmU0/EFkTbbdBnK2iYw/w24I6u5ORsR1OjP NvQL1vw1dn0PsW8XZzYt7vrZuKd41B4X/0udSmxG7Wik20e3HITuLf+kHlTq/SOVx9kb+3BucjXbv rrreJmIQ==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1pkR7v-00AYJQ-0d; Thu, 06 Apr 2023 15:02:15 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 184893000DC; Thu, 6 Apr 2023 17:02:14 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id F2B1E212E36AA; Thu, 6 Apr 2023 17:02:13 +0200 (CEST) Date: Thu, 6 Apr 2023 17:02:13 +0200 From: Peter Zijlstra To: Marcelo Tosatti Cc: Frederic Weisbecker , Yair Podemsky , 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, x86@kernel.org, hpa@zytor.com, will@kernel.org, aneesh.kumar@linux.ibm.com, akpm@linux-foundation.org, arnd@arndb.de, keescook@chromium.org, paulmck@kernel.org, jpoimboe@kernel.org, samitolvanen@google.com, ardb@kernel.org, juerg.haefliger@canonical.com, rmk+kernel@armlinux.org.uk, geert+renesas@glider.be, tony@atomide.com, linus.walleij@linaro.org, sebastian.reichel@collabora.com, nick.hawkins@hpe.com, linux-kernel@vger.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, vschneid@redhat.com, dhildenb@redhat.com, alougovs@redhat.com, jannh@google.com Subject: Re: [PATCH 3/3] mm/mmu_gather: send tlb_remove_table_smp_sync IPI only to CPUs in kernel mode Message-ID: <20230406150213.GQ386572@hirez.programming.kicks-ass.net> References: <20230404134224.137038-1-ypodemsk@redhat.com> <20230404134224.137038-4-ypodemsk@redhat.com> <20230405195226.GB365912@hirez.programming.kicks-ass.net> <20230406132928.GM386572@hirez.programming.kicks-ass.net> <20230406140423.GA386634@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230406140423.GA386634@hirez.programming.kicks-ass.net> X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE 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 Thu, Apr 06, 2023 at 04:04:23PM +0200, Peter Zijlstra wrote: > On Thu, Apr 06, 2023 at 03:29:28PM +0200, Peter Zijlstra wrote: > > On Thu, Apr 06, 2023 at 09:38:50AM -0300, Marcelo Tosatti wrote: > > > > > > To actually hit this path you're doing something really dodgy. > > > > > > Apparently khugepaged is using the same infrastructure: > > > > > > $ grep tlb_remove_table khugepaged.c > > > tlb_remove_table_sync_one(); > > > tlb_remove_table_sync_one(); > > > > > > So just enabling khugepaged will hit that path. > > > > Urgh, WTF.. > > > > Let me go read that stuff :/ > > At the very least the one on collapse_and_free_pmd() could easily become > a call_rcu() based free. > > I'm not sure I'm following what collapse_huge_page() does just yet. DavidH, what do you thikn about reviving Jann's patches here: https://bugs.chromium.org/p/project-zero/issues/detail?id=2365#c1 Those are far more invasive, but afaict they seem to do the right thing.