Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2659493rwb; Mon, 7 Nov 2022 16:24:43 -0800 (PST) X-Google-Smtp-Source: AMsMyM6vCS3ku56mmuykPS14RPzrdyNCqLtXDOuL+OEWeFhApMp6M3wfaypbVN9SaJXqhi9FOJsJ X-Received: by 2002:a17:906:22d5:b0:7ad:f0af:66dc with SMTP id q21-20020a17090622d500b007adf0af66dcmr33498175eja.696.1667867083440; Mon, 07 Nov 2022 16:24:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667867083; cv=none; d=google.com; s=arc-20160816; b=pOI6SImHZ75mQk+FtSRbWGmrfrWsuBltKwds8wqDBhKse4aEKYNOaKaTkbJJtVJUyA XkpnqlkYx1CQ45QfgGr80vQbqJHGrXq9rCsZwQx+N1OaHUEO4Vfp12a63nnukffjv1+h f3Rc0i3WYGz7L1WpXgpKgdjJhXq7RaSS/JounS1EXkQMjjZ4uQ/DtqO4uNCHdoO+Xg5u rUFwOp2xRt1h4XV/AQxm1q237X+at8gR0EBniI9L9fZgwkM6V7L3XJhlbJ4vrYlYhZtW 6Hsa0QAjPRtCbxtAS3942Ci/e3YVYrZ7CpZcQaicayatq6jsAWBviP+IFcszaekKq04b hNyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=2nUGmNm82TyRLx97jZms1dOOGi76NwVe8JFuVeWiOQg=; b=AJhmWLofxE4188cQwkP9ei0c0+PVb/Ri2u/5FTcq8Rk5atVR7zEQHXWKvW1EVXMz5n ZMb+EP9i7zOeSejzlPNXeDInz+EhHSsz2uIaRJNUkECYnL5PC9nShDu8IsPMWnPJdwkx yaZIOFBwVm2jDN3XoTG3FgOzZaWsBZ9iDJxbKqBl6yfYBCWMX6JQIcj6R/zScy2p+42d tM+oNd4FI9fh988jw243U60f7pTXWiigY50iQl1FuJsmp6vBtpqBip+dOzdMPgpfi8QP C0enevvQHRf90hK9D0lhdhCukUNQlk1Z0dv/Hgm7wEB3oeXX/T8jXE0GnlER2hO0ZtDP ukfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=My5uqWQw; 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 u9-20020a170906124900b007ae4717bf0fsi8325152eja.158.2022.11.07.16.24.19; Mon, 07 Nov 2022 16:24:43 -0800 (PST) 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=@linux-foundation.org header.s=google header.b=My5uqWQw; 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 S232411AbiKGXsB (ORCPT + 92 others); Mon, 7 Nov 2022 18:48:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230362AbiKGXr7 (ORCPT ); Mon, 7 Nov 2022 18:47:59 -0500 Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1294D1C91F for ; Mon, 7 Nov 2022 15:47:59 -0800 (PST) Received: by mail-qk1-x733.google.com with SMTP id f8so8218888qkg.3 for ; Mon, 07 Nov 2022 15:47:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=2nUGmNm82TyRLx97jZms1dOOGi76NwVe8JFuVeWiOQg=; b=My5uqWQwXOffTiWXNHqYQhulwxGxYGEm7K9+0FNU7iSCJTiHIpLKcqjmRdDQF+ZBkb Pg1ba84w3LhFXgshAIEFlqw202AajwYhP3vp8snD7MElUpy1fGUKi0JL4ot9xEL1OZHD srxGnutg7uHNcTHztzXfNg/I2NN1QnphRTqmo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2nUGmNm82TyRLx97jZms1dOOGi76NwVe8JFuVeWiOQg=; b=PWd30J+MdyM8UEneOjhFJ9r3bpshdMBh5DENCkkCjdWYZxwUz6gWVUJdXxDKcAqccX WDV5Zkt/KOBLEj5WelD35+mLsoZgKQBimL72oReRQtktXySifRMwpp3H1LMR48GlwcRw cizTRCi31yAo2dXUZdPW9t8Xyv40CN9M2BGobBnuiFIXguxS4LlmZpV2Tq0/CD7A8gTP wD8LHMjvA7ojCMruXpTcFRrtDejyF6LO0Ua2GRNKGxMuS01N6KZCpC30WcihXU2iNEHo r8Q4bvGRCjWHJxD2DDJP6Pqy+xt1EvGsTDQmF+XMZ7l7lAB49oKyn27WdR9gKokHjWjz 9tLw== X-Gm-Message-State: ACrzQf29ATInoFxCF1JjbM2z5ouBPNf8KEZpLuZ24wDjdHf/vp5SbFx7 Lt7VKm269YyB/k0ZKGdU/eiUEeT/Zoh5Sw== X-Received: by 2002:a05:620a:12ca:b0:6fa:24c3:bb17 with SMTP id e10-20020a05620a12ca00b006fa24c3bb17mr33246039qkl.393.1667864878010; Mon, 07 Nov 2022 15:47:58 -0800 (PST) Received: from mail-yw1-f176.google.com (mail-yw1-f176.google.com. [209.85.128.176]) by smtp.gmail.com with ESMTPSA id cj25-20020a05622a259900b003a4c3c4d2d4sm7004428qtb.49.2022.11.07.15.47.55 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Nov 2022 15:47:56 -0800 (PST) Received: by mail-yw1-f176.google.com with SMTP id 00721157ae682-370547b8ca0so120016447b3.0 for ; Mon, 07 Nov 2022 15:47:55 -0800 (PST) X-Received: by 2002:a81:114e:0:b0:36a:fc80:fa62 with SMTP id 75-20020a81114e000000b0036afc80fa62mr51708860ywr.58.1667864875345; Mon, 07 Nov 2022 15:47:55 -0800 (PST) MIME-Version: 1.0 References: <8a1e97c9-bd5-7473-6da8-2aa75198fbe8@google.com> In-Reply-To: From: Linus Torvalds Date: Mon, 7 Nov 2022 15:47:38 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: mm: delay rmap removal until after TLB flush To: Johannes Weiner Cc: Hugh Dickins , Stephen Rothwell , Alexander Gordeev , Peter Zijlstra , Will Deacon , Aneesh Kumar , Nick Piggin , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Sven Schnelle , Nadav Amit , Jann Horn , John Hubbard , X86 ML , Matthew Wilcox , Andrew Morton , kernel list , Linux-MM , Andrea Arcangeli , "Kirill A . Shutemov" , Joerg Roedel , Uros Bizjak , Alistair Popple , linux-arch Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no 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 Mon, Nov 7, 2022 at 12:29 PM Linus Torvalds wrote: > > That said, if always doing the rmap removal under the page table lock > means that that memcg lock can just be deleted in that whole path, I > will certainly bow to _that_ simplification instead, and just handle > the dirty pages after the TLB flush but before the page table drop. Ok, so I think I have a fairly clean way to do this. Let me try to make that series look reasonable, although it might be until tomorrow. I'll need to massage my mess into not just prettier code, but a sane history. Linus