Received: by 2002:a05:6358:795:b0:dc:4c66:fc3e with SMTP id n21csp842898rwj; Sat, 29 Oct 2022 11:51:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7YGoyLFASg87gHs2iI2yyV7WKqmpDPJMLU6n2uNOPbrU45YQtNaueMJoWlTtgbMil45fwc X-Received: by 2002:a17:903:124e:b0:179:da2f:244e with SMTP id u14-20020a170903124e00b00179da2f244emr5698281plh.169.1667069461053; Sat, 29 Oct 2022 11:51:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667069461; cv=none; d=google.com; s=arc-20160816; b=Ey13WTo0PROOkBENlHeNW/rA2yGCMAs/T6+sKgPmXJ/cemXfoYDHlho8x33f4XfOO4 tiTjCHANowUDgAr62iTXkc1bt62g/OuvSXwVwH/RenZKvUeawAcDGgKJTVJV8DRER3m3 ENyQV/25ZkUYTwmqH72miWESQu1w39XoESi+3KgAlRlBO86oO1gNuY0SMES64rvNTpEa /8X4tO1wekmn8nhwBRyFQZ9NS15p7iCD0AEN4dl3g7TVDutpAv34XnJHS3PsyAwXvmsH b83lI/Iq0Nbttkz5G/GvldjmVPhODr4kMD1dBrFWZFSTHuqcTQIJzRaAYHU6ePxglH83 ZyKw== 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=76M6lk7kfgu31CI5okzzmnnwo4O4f75sK07trq47018=; b=HCc9Jbhr2XBEihRVgA8DjBwTnPaM52yzLh6TmoeifNeh3o674o3sEr4kDSFnJlm7JK NS0gwnYwjfPHLreIhjts6O+t51B9xVIJcys2lZBLtz3lfJbu2vVmWpyxMqUQXy0tF6Xe JwPu3FEkcu0r2gZ+5mScUBHp11YxHwnHXGeELF9fLVBA66cja8L0DGi0z5hBHgOT9nM9 pML5KYL9hcpEYz3C25csaCwSAAR5OZfd4OmHn3Af+wkMPhWjBZxYW9ROIzXT48+fLvGU 1FEsDqLJqB/WQ30cR7cFrfIauxkT8UzHLYBcT0mS1VKXcgrDtzDYS9iP58Lh9sMrQIF+ EQZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=CMDfFoaV; 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 5-20020a17090a0f8500b0020d457c5083si2600502pjz.147.2022.10.29.11.50.49; Sat, 29 Oct 2022 11:51:01 -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=@linux-foundation.org header.s=google header.b=CMDfFoaV; 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 S229549AbiJ2ShS (ORCPT + 99 others); Sat, 29 Oct 2022 14:37:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229494AbiJ2ShR (ORCPT ); Sat, 29 Oct 2022 14:37:17 -0400 Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FFA136876 for ; Sat, 29 Oct 2022 11:37:15 -0700 (PDT) Received: by mail-qk1-x734.google.com with SMTP id i10so5279142qkl.12 for ; Sat, 29 Oct 2022 11:37:15 -0700 (PDT) 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=76M6lk7kfgu31CI5okzzmnnwo4O4f75sK07trq47018=; b=CMDfFoaVlAqhmO76DDLzJEcQXcOJZ3uiOCX7jQ56KKcSaGzHYi9XHSOiJmUKL3KQl2 ib56ytK8djxG06UFpH8tLK52Rqwmte8mUYBP8Hh26aH+65xTcJY3/jOecO/pubZwS+0W lMJT8vxyWtnItVijfmTm+dkVHgAu2mBxm0oI8= 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=76M6lk7kfgu31CI5okzzmnnwo4O4f75sK07trq47018=; b=YxsmEwhljyIloL/9mZCeU89uqn9LJxIN00xbojwcppj6OmyyBLJSYX0062/Vr661u9 /0G2DgEFtI8VRdy/27znL6UtHtfnQ65m1MBe/tBWoxpFMkOaejMPITJOn0Z8/3emacH3 ybVIyhnO4SIwS7/yn2QW69dWWt4JODLkd/UI+kJgQu7WvirouTLWnpsEsuiUx4n4CByL eYdyCDf3/KX3m+VTkzyp8n3/qg4iK9nRtauG+UR6UhPvd3wqePLXpS5ektFn5ZtGq288 7p6U/mX8aoJatl/WBKV8jRgmTa5qMPwoYI0cVo+FRYTuPj5c0LsFR7Yse+AIVZVLAB49 TGLA== X-Gm-Message-State: ACrzQf2aZmsX5brIHJiWTWszhm47TH2eNAwNnMvjHCK5nvlebC5Y329v 5uw/O+Z1cEWNuhvTIOCRWoEnkQW2T/VLHA== X-Received: by 2002:a05:620a:4713:b0:6ee:e87d:d1a5 with SMTP id bs19-20020a05620a471300b006eee87dd1a5mr3836756qkb.589.1667068634224; Sat, 29 Oct 2022 11:37:14 -0700 (PDT) Received: from mail-yb1-f170.google.com (mail-yb1-f170.google.com. [209.85.219.170]) by smtp.gmail.com with ESMTPSA id u21-20020a37ab15000000b006fa1dc83a36sm599529qke.64.2022.10.29.11.37.10 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 29 Oct 2022 11:37:10 -0700 (PDT) Received: by mail-yb1-f170.google.com with SMTP id 187so9557124ybe.1 for ; Sat, 29 Oct 2022 11:37:10 -0700 (PDT) X-Received: by 2002:a5b:984:0:b0:6ca:9345:b2ee with SMTP id c4-20020a5b0984000000b006ca9345b2eemr4420709ybq.362.1667068629989; Sat, 29 Oct 2022 11:37:09 -0700 (PDT) MIME-Version: 1.0 References: <20221022111403.531902164@infradead.org> <20221022114424.515572025@infradead.org> <2c800ed1-d17a-def4-39e1-09281ee78d05@nvidia.com> <6C548A9A-3AF3-4EC1-B1E5-47A7FFBEB761@gmail.com> <47678198-C502-47E1-B7C8-8A12352CDA95@gmail.com> In-Reply-To: <47678198-C502-47E1-B7C8-8A12352CDA95@gmail.com> From: Linus Torvalds Date: Sat, 29 Oct 2022 11:36:53 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 01/13] mm: Update ptep_get_lockless()s comment To: Nadav Amit Cc: Peter Zijlstra , Jann Horn , John Hubbard , X86 ML , Matthew Wilcox , Andrew Morton , kernel list , Linux-MM , Andrea Arcangeli , "Kirill A . Shutemov" , jroedel@suse.de, ubizjak@gmail.com, Alistair Popple Content-Type: multipart/mixed; boundary="0000000000008225b205ec30a9c6" 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 --0000000000008225b205ec30a9c6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Oct 29, 2022 at 11:05 AM Nadav Amit wrote: > > Anyhow, I am not sure whether the solution that you propose would work. > Please let me know if my understanding makes sense. Let me include my (UNTESTED! PROBABLY GARBAGE!) patch here just as a "I meant something like this". Note that it's untested, but I tried to make it intentionally use different names and an opaque type in the 'mmu_gather' data structure so that at least these bit games end up being type-safe and more likely to be correct if it compiles. And I will say that it does compile for me - but only in my normal x86-64 config. I haven't tested anything else, and I guarantee it won't build on s390, for example, because s390 has its own mmu_gather functions. > Let=E2=80=99s assume that we do not call set_page_dirty() before we remov= e the rmap > but only after we invalidate the page [*]. Let=E2=80=99s assume that > shrink_page_list() is called after the page=E2=80=99s rmap is removed and= the page > is no longer mapped, but before set_page_dirty() was actually called. > > In such a case, shrink_page_list() would consider the page clean, and wou= ld > indeed keep the page (since __remove_mapping() would find elevated page > refcount), which appears to give us a chance to mark the page as dirty > later. Right. That is not different to any other function (like "write()" having looked up the page. > However, IIUC, in this case shrink_page_list() might still call > filemap_release_folio() and release the buffers, so calling set_page_dirt= y() > afterwards - after the actual TLB invalidation took place - would fail. I'm not seeing why. That would imply that any "look up page, do set_page_dirty()" is broken. They don't have rmap either. And we have a number of them all over (eg think "GUP users" etc). But hey, you were right about the stale TLB case, so I may just be missing something. I *think* the important thing is just that we need to mark the page dirtty from the page tables _after_ we've flushed the TLB, just to make sure that there can be no subsequent dirtiers that then get lost. Anyway, I think the best documentation for "this is what I meant" is simply the patch. Does this affect your PoC on your setup? I tried to run your program on my machine (WITHOUT this patch - I have compiled this patch, but I haven't even booted it - it really could be horrible broken). But it doesn't fail for me even without the patch and I just get "Finished without an error" over and over again - but you said it had to be run on a RAM block device, which I didn't do, so my testing is very suspect,. Again: THIS PATCH IS UNTESTED. I feel like it might actually work, if only because I tried to be so careful with the type system. But that "might actually work" is probably me being wildly optimistic, and also depends on the whole concept being ok in the first place. So realistically, think of this patch more as a "document in code what Linus meant with his incoherent ramblings" rather than anything else. Hmm? Linus --0000000000008225b205ec30a9c6 Content-Type: text/x-patch; charset="US-ASCII"; name="patch.diff" Content-Disposition: attachment; filename="patch.diff" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_l9u9ll4z0 IGluY2x1ZGUvYXNtLWdlbmVyaWMvdGxiLmggfCAyOCArKysrKysrKysrKysrKysrKysrKysrKy0t LS0tCiBtbS9tZW1vcnkuYyAgICAgICAgICAgICAgIHwgMTcgKysrKysrKystLS0tLS0tLS0KIG1t L21tdV9nYXRoZXIuYyAgICAgICAgICAgfCAzNiArKysrKysrKysrKysrKysrKysrKysrKysrKysr KysrKy0tLS0KIDMgZmlsZXMgY2hhbmdlZCwgNjMgaW5zZXJ0aW9ucygrKSwgMTggZGVsZXRpb25z KC0pCgpkaWZmIC0tZ2l0IGEvaW5jbHVkZS9hc20tZ2VuZXJpYy90bGIuaCBiL2luY2x1ZGUvYXNt LWdlbmVyaWMvdGxiLmgKaW5kZXggNDkyZGNlNDMyMzZlLi5hOTUwODVmNmRkNDcgMTAwNjQ0Ci0t LSBhL2luY2x1ZGUvYXNtLWdlbmVyaWMvdGxiLmgKKysrIGIvaW5jbHVkZS9hc20tZ2VuZXJpYy90 bGIuaApAQCAtMjM4LDExICsyMzgsMjkgQEAgZXh0ZXJuIHZvaWQgdGxiX3JlbW92ZV90YWJsZShz dHJ1Y3QgbW11X2dhdGhlciAqdGxiLCB2b2lkICp0YWJsZSk7CiAgKi8KICNkZWZpbmUgTU1VX0dB VEhFUl9CVU5ETEUJOAogCisvKiBGYWtlIHR5cGUgZm9yIGFuIGVuY29kZWQgcGFnZSBwb2ludGVy IHdpdGggdGhlIGRpcnR5IGJpdCBpbiB0aGUgbG93IGJpdCAqLworc3RydWN0IGVuY29kZWRfcGFn ZTsKKworc3RhdGljIGlubGluZSBzdHJ1Y3QgZW5jb2RlZF9wYWdlICplbmNvZGVfcGFnZShzdHJ1 Y3QgcGFnZSAqcGFnZSwgYm9vbCBkaXJ0eSkKK3sKKwlyZXR1cm4gKHN0cnVjdCBlbmNvZGVkX3Bh Z2UgKikoZGlydHkgfCAodW5zaWduZWQgbG9uZylw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