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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0C1FC4332F for ; Tue, 15 Nov 2022 18:11:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 688896B0071; Tue, 15 Nov 2022 13:11:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 638978E0001; Tue, 15 Nov 2022 13:11:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 501896B0073; Tue, 15 Nov 2022 13:11:18 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 42B496B0071 for ; Tue, 15 Nov 2022 13:11:18 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 106B31210BB for ; Tue, 15 Nov 2022 18:11:18 +0000 (UTC) X-FDA: 80136468636.30.ECDF84C Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf01.hostedemail.com (Postfix) with ESMTP id C13C24001A for ; Tue, 15 Nov 2022 18:11:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668535875; 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: in-reply-to:in-reply-to:references:references; bh=1eer18dOX5R+bHPKMAIktRCptAEoDyYz4Wl1rWvmd9Y=; b=ZrG03SBCLYIuc4XKVJ/uHkkfXXiolLIwCJEsaTZmMvguBhIunGT3iY9lO89ZhK1Nh8JM50 iEThofyJgURsBeuDeRJsSMbj5IocZ0y2559q5tsR93hpWJX7lKdgrwW9mDlyO2bqZrAEh3 Q9qe7F/ZiPMJtjHBsonvpg6tQhlkxVc= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-622-Js3kfqN2Nw-8rQViVmDYbg-1; Tue, 15 Nov 2022 13:11:13 -0500 X-MC-Unique: Js3kfqN2Nw-8rQViVmDYbg-1 Received: by mail-qt1-f199.google.com with SMTP id fb5-20020a05622a480500b003a525d52abcso10839816qtb.10 for ; Tue, 15 Nov 2022 10:11:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=1eer18dOX5R+bHPKMAIktRCptAEoDyYz4Wl1rWvmd9Y=; b=BitrbNxAL8tlX39gu0j53OjFqEiju1w9ebpugt4+EzItoM2YxJPLt23EAUcAHPy2yV wbeK/pKZYzBFOqPE1W29OE5UJ5W77dMmadTel5wwjEAnX/UB2DmCewZ/2iPXx2+eAJ2/ bhvjazMqOUubNcjWUgg4wDa7ZXuSTCcPtICV7RfNZrEQs3HkhCFu2optSkR8SiaqKG9t 6pTCyma3OxldF1BDaIza3ccKVJcFQhMxprmUT5IeJ7atiia8syzNWgeMwHsul3OIjb+s UMdpBCxuV1/3p5+jrn/ZU4jR9Cxce5LUQoSwJe7GUM1tHaLJnRv7fKRUfsWZKh+0UW4C Cf2Q== X-Gm-Message-State: ANoB5pl6LzHDS31DdRRguLw6WM6mh5GkSo8cI3BU9xdrbkClOcVvF4Iw V+PO1RWyCUfF51RFmNtYsCZNVz+nWUu11lSwhDnO6iZDElsdAP6zZNI4ehaDkaBh5QyMat2g+wL c6EvTfIGYShs= X-Received: by 2002:a05:620a:cca:b0:6fa:2a50:f884 with SMTP id b10-20020a05620a0cca00b006fa2a50f884mr16066921qkj.741.1668535873166; Tue, 15 Nov 2022 10:11:13 -0800 (PST) X-Google-Smtp-Source: AA0mqf6XBKkpt/Bs7c0cNYLkP4Cbh98dkNqTGjUQOJIIGYCpdr6clNBw82n+v7GW7OGh9k0xZvIOow== X-Received: by 2002:a05:620a:cca:b0:6fa:2a50:f884 with SMTP id b10-20020a05620a0cca00b006fa2a50f884mr16066903qkj.741.1668535872949; Tue, 15 Nov 2022 10:11:12 -0800 (PST) Received: from x1n (bras-base-aurron9127w-grc-46-70-31-27-79.dsl.bell.ca. [70.31.27.79]) by smtp.gmail.com with ESMTPSA id e7-20020ac84b47000000b0039953dcc480sm7473363qts.88.2022.11.15.10.11.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Nov 2022 10:11:12 -0800 (PST) Date: Tue, 15 Nov 2022 13:11:11 -0500 From: Peter Xu To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrea Arcangeli , Axel Rasmussen , Ives van Hoorne , Nadav Amit , Andrew Morton , Mike Rapoport , stable@vger.kernel.org Subject: Re: [PATCH v2 1/2] mm/migrate: Fix read-only page got writable when recover pte Message-ID: References: <20221110203132.1498183-1-peterx@redhat.com> <20221110203132.1498183-2-peterx@redhat.com> <9af36be3-313b-e39c-85bb-bf30011bccb8@redhat.com> <82d7a142-8c78-4168-37e9-7b677b18987a@redhat.com> <2ed12722-2359-cb07-53e7-566d959d311e@redhat.com> MIME-Version: 1.0 In-Reply-To: <2ed12722-2359-cb07-53e7-566d959d311e@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668535875; a=rsa-sha256; cv=none; b=xxfElnrIpvbWYyrX20MKkcXO5QRl9Ap26+7sNLMR6YMKWWhLZVxnjYnixWqgereVM1+FOa ZKPkenKfaLE7cjjhrRKtV2KOYTw45lAaQUALZ8cleryGglhv5YiTYMcp/nG62HUUM7RAyq BvLRQg22/l26/LBItZEQYyw192DbrcI= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ZrG03SBC; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf01.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668535875; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=1eer18dOX5R+bHPKMAIktRCptAEoDyYz4Wl1rWvmd9Y=; b=0F+HdsxWtIbC23s0v2ellfbGw+V5zHkVVn62ZaHaUV8v/I5dB5yFnXNQ8jxHT6l9y7ERqX z3wFzjM66DGOIquApG3ncNWiGVCWfTutcZx4bmdIQqLQX+nJYIp6DhCzleqLVT6FDwIonY iS5GTOI6npN6Xv39BJei8O/DgwH4DyM= Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ZrG03SBC; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf01.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com X-Rspam-User: X-Stat-Signature: dmbmyfdyns3u6n6x3x1y7p7pzhoo1qbq X-Rspamd-Queue-Id: C13C24001A X-Rspamd-Server: rspam11 X-HE-Tag: 1668535875-927954 X-Bogosity: Ham, tests=bogofilter, spamicity=0.021882, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Nov 15, 2022 at 06:54:09PM +0100, David Hildenbrand wrote: > No it isn't natural. But sneaking such a change into your fix seems wrong. > Touching !uffd-wp code should be separate, if we want to do this at all (as > we discussed, maybe the better/cleaner approach is to eliminate writable > migration entries if possible). If you see I made the subject as mm/migrate, because I took it as a migration change, not uffd-wp specific. I also added the Fixes to the uffd patch because afaict that's the only thing that it affects, but I can't tell either. As I said, I'm trying to follow the rule where we have read entry I want to make sure write bit removed. I hope we have this patch land soon, because it affects users. I'm not against further rework on migration entries as I replied in the other email, but for this patch I keep the same thoughts as when I posted. Thanks, -- Peter Xu