Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2532666rwl; Thu, 6 Apr 2023 11:33:34 -0700 (PDT) X-Google-Smtp-Source: AKy350aMate7SzpYW1LEi4t+wofX3fSvjDw4xlDn8AndtoU23ywAhGBFZv2Ns6tvtYgzqBUWVEzr X-Received: by 2002:a05:6402:289:b0:4ad:1e35:771f with SMTP id l9-20020a056402028900b004ad1e35771fmr486083edv.35.1680806014579; Thu, 06 Apr 2023 11:33:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680806014; cv=none; d=google.com; s=arc-20160816; b=Aasf51tgZRqLiJ/VnAcK7aoQMViL5/oMTWZUZt8jmfjA7DE3i6wNEwr6Bi+npYbcVA A7yBPeYnqA0BCiY3kcq9tE28Tutwm2gHIJU0+R9K9VEkZlgDpaZQLdCNRid9NVieeZNU u8H4rGdIM/p7Ed3ZRvXKuAsJnBm3d3BmKqV0TmVzKo460D5t+sjMRfDLNtMUTwX235HS x0oPriVHlwq6bxRZQSqOilwH/QNi0Cd/wH6N3PEEUkG90t9KNhum5n0fU3M/7UvAGY+Z 4abNaZWQf3/CUlNjKHz4snXeWoUll8xEDW2QZ9F2cIpIXPu77etUaA4JXR/8phDFAuym u1xg== 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=krRR1rbNljM3A0v7Or9ollBea6RqbuAL/TrS9ntMbko=; b=R4rSemwEZwTdsBckPmR5ssA1jMWnE6AV1u1DpbCS+pNo3Rhi7zFDqzLE8jU2du8pPw 5M5FCF0pGgL46Hj5+vJeh6cEZADvSJnXUV3obHGFDT8R22dzM3bo3f1RoCFEOIee4Bjj U0UEcAbojjgydele9AfcUe+J5Oq3urGFV8Y0httKb7orte9GHBH/8ZcbSuxmonPP1cTT Z3gHZ6m8BkiTS+/U3C1YtMHDUmWuGGszavUW7wM8xEBv1qZAPZi07eN5JEmbRZe8nTmm 5Y+29chX9i83Q/7FHP4HH+GS9z7W+JmQKPl9+qlU1jMYqrJVvrOX6vz8TWprzRFXIj9V 60yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=HYwyP555; 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 d23-20020aa7d5d7000000b004bf8e1ad475si1639283eds.235.2023.04.06.11.33.08; Thu, 06 Apr 2023 11:33:34 -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=HYwyP555; 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 S240083AbjDFS2y (ORCPT + 99 others); Thu, 6 Apr 2023 14:28:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229674AbjDFS2w (ORCPT ); Thu, 6 Apr 2023 14:28:52 -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 451D759FA; Thu, 6 Apr 2023 11:28:51 -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=krRR1rbNljM3A0v7Or9ollBea6RqbuAL/TrS9ntMbko=; b=HYwyP5557eX2aBI0hUlezid1GH 5hoyG1Aj5dHjNeznaZOFr7Cy51rbii3Y5i3cE2woInFfeI8EAPtppz3o99BPe2GIduN6vXv6uyaw7 R9cuTob59q/BPrQnGdBywtK77Stl8OJJpBnvpSy/YFDL7vPiYkNIMiGQPDEidGAvoA4jROBnBdVah jOoSwHyGjI0QMaTrXlud204St1NXsF+ujX5WasSumcwLZCeKMORJsJy5xkcpHYXjSOgsSKV186/O/ cA0kt/u7rjhL3oPljvBtkfjk5sjNe9coia8oht3RGaO73x29c2Bi67dc2zk8arCu3QV+LNr4pLHNl VKwPG5qQ==; 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 1pkUKx-00Ad17-2X; Thu, 06 Apr 2023 18:27:55 +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) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id BDA6530008D; Thu, 6 Apr 2023 20:27:49 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A5453212E36AA; Thu, 6 Apr 2023 20:27:49 +0200 (CEST) Date: Thu, 6 Apr 2023 20:27:49 +0200 From: Peter Zijlstra To: David Hildenbrand Cc: Marcelo Tosatti , 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, Yang Shi Subject: Re: [PATCH 3/3] mm/mmu_gather: send tlb_remove_table_smp_sync IPI only to CPUs in kernel mode Message-ID: <20230406182749.GA405948@hirez.programming.kicks-ass.net> References: <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> <20230406150213.GQ386572@hirez.programming.kicks-ass.net> <248392c0-52d1-d09d-75ec-9e930435c053@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <248392c0-52d1-d09d-75ec-9e930435c053@redhat.com> 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 05:51:52PM +0200, David Hildenbrand wrote: > On 06.04.23 17:02, Peter Zijlstra wrote: > > 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. > > > > I recall seeing those while discussed on security@kernel.org. What we > currently have was (IMHO for good reasons) deemed better to fix the issue, > especially when caring about backports and getting it right. Yes, and I think that was the right call. However, we can now revisit without having the pressure of a known defect and backport considerations. > The alternative that was discussed in that context IIRC was to simply > allocate a fresh page table, place the fresh page table into the list > instead, and simply free the old page table (then using common machinery). > > TBH, I'd wish (and recently raised) that we could just stop wasting memory > on page tables for THPs that are maybe never going to get PTE-mapped ... and > eventually just allocate on demand (with some caching?) and handle the > places where we're OOM and cannot PTE-map a THP in some descend way. > > ... instead of trying to figure out how to deal with these page tables we > cannot free but have to special-case simply because of GUP-fast. Not keeping them around sounds good to me, but I'm not *that* familiar with the THP code, most of that happened after I stopped tracking mm. So I'm not sure how feasible is it. But it does look entirely feasible to rework this page-table freeing along the lines Jann did.