Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2356984rwb; Fri, 9 Dec 2022 00:43:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf4s34h0KVIm0HFayhqPL5ES4SufzSPI/yb2fGTWt4U0p7JRD3LmtYaXLmHTEtiFjDUtJVIF X-Received: by 2002:aa7:cb95:0:b0:468:3404:27cc with SMTP id r21-20020aa7cb95000000b00468340427ccmr6317962edt.39.1670575438453; Fri, 09 Dec 2022 00:43:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670575438; cv=none; d=google.com; s=arc-20160816; b=ubCm0uDbcksRu0YFc+JvAM3lgRHOHLjYD7EtJ++Y9PdPzzle2R65jInDY80gSw+yl2 77A9JM9Fuww2/0KzLawK0hqkxn2m1qMEFGI8q8alnnqTuc8nQFoCKYyLHTbS/EtOm7xc wJAcgf7j9pkIzBeLateOH6DR3Pzbp2o1J2NzjnxSyxqUUUhO3z+0H8lQi4TgXbmDCJe8 oOd1d7U6TSJnRE42pI/3DXU+dTIi9wT0qag3PzhLmtJtiLdNzUsLmNRcNTU5ZXsY7ADU tuA9ECn1LubqNsFBgmyG4BJJrI/XfVxpkSKCcNh0Jm7foqnDBFFh6nOAd7yZ3rTmGcaI SJxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=g6IK0RYF1mOQiFFce0wSrPhJPVQgIzsR5SoBxpS0hXY=; b=OmSzmdlSazVgqMIZl2/OpCPbejHiTbbYIBzbMTbFHTQ9yrL9uPVcnvYcLp1WTR5/rx oAlZvJ8Wx3f6q+xFUxKXHrpZP23JHwrSIAuslRWke0USxwUOgHZ9sIx8fJ/1cyQfKNql /lip1mw2n14SXzuAkDISH9xbuJadQiZrb86/P1DBB73rIpTnTmmH0bSFqLK1ZgcMp9ij OKRdtphwJUxoMylV4gUPAF2TXYqDkrvQJcERRl0AkT4v7odpkWC2cX7kjae0usT6Il1I D4O9uoTkPG6mw0b2Xto67LYqDOtwIR52vo/jvZfvk2Hgs9dc2xQXqEEm5tWVpSOHXFwH t7mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XULlyeTB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i2-20020aa7c702000000b0046c46bc5c9csi805463edq.327.2022.12.09.00.43.40; Fri, 09 Dec 2022 00:43:58 -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=@redhat.com header.s=mimecast20190719 header.b=XULlyeTB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229885AbiLIIIp (ORCPT + 73 others); Fri, 9 Dec 2022 03:08:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbiLIIIn (ORCPT ); Fri, 9 Dec 2022 03:08:43 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 868A01DF35 for ; Fri, 9 Dec 2022 00:07:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670573268; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=g6IK0RYF1mOQiFFce0wSrPhJPVQgIzsR5SoBxpS0hXY=; b=XULlyeTBke19xgHeCRXM8ZQd5lwov37fDBpj6HR5gbuhj6p768XDyBm1/MsBIUfNr5wwgr uW6TJ4L1J6ihKEQp9dK99p3NPxJZGi3ZwxPd5zVaSCiIBryMfceQsmey5d3PPovv0DXeuv I9DItlEV5wnxtRNbH0/+RLwDtjCaoXI= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-375-qs_HBVHUN0CKIf26w2q4ag-1; Fri, 09 Dec 2022 03:07:47 -0500 X-MC-Unique: qs_HBVHUN0CKIf26w2q4ag-1 Received: by mail-wm1-f71.google.com with SMTP id m38-20020a05600c3b2600b003d1fc5f1f80so2980766wms.1 for ; Fri, 09 Dec 2022 00:07:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=g6IK0RYF1mOQiFFce0wSrPhJPVQgIzsR5SoBxpS0hXY=; b=BO3XGa1YMm3XHzXmN5x2n3Yc6P2h3dPVg7rDKzTV/Baoo+X5FWLlEuaqr28o+Kpjpb xx/79n0itWqvT3snBlqeliCMAq4KziAaP+hwy4AXteyYJa6j8BR41fMzBQVdQ0Z70ezq PTKqGeW3EvUJk0roUw9B+d5g5GyES3W07xPEbH9lKvPYGR0b/zuX0BUoGHLVHtRILlSS 9E9nm6phadisfZ6DVpBprtMEDC53ffCxPUsMlM7U5liDiHiw0O7CFvLM7xGwSyltt9dV I54a9Z9riKITRMowBpA1jxNGdLFpGbgTB3gqj9mNmSa7f/nISERJuFDsw7t0XktGzolR M1eQ== X-Gm-Message-State: ANoB5plsRCx9Nubt/0BWE+jisNleaU4xRJ38ZP3ONe0tHBAsFkQOlr0C 0wyA2p5Pv2Cw5+RfU5VkRgMTAy+HARLpUfhE5nB/gPeFaxHeknCU1B8xYrpxuPZPmpBXyihOeta sr0ARtKfsbF+cEBxbEEfv0FZK X-Received: by 2002:a05:600c:3549:b0:3c6:e61e:ae8c with SMTP id i9-20020a05600c354900b003c6e61eae8cmr5001711wmq.28.1670573266447; Fri, 09 Dec 2022 00:07:46 -0800 (PST) X-Received: by 2002:a05:600c:3549:b0:3c6:e61e:ae8c with SMTP id i9-20020a05600c354900b003c6e61eae8cmr5001690wmq.28.1670573266112; Fri, 09 Dec 2022 00:07:46 -0800 (PST) Received: from ?IPV6:2003:cb:c702:2e00:b9ea:114c:a3f5:327e? (p200300cbc7022e00b9ea114ca3f5327e.dip0.t-ipconnect.de. [2003:cb:c702:2e00:b9ea:114c:a3f5:327e]) by smtp.gmail.com with ESMTPSA id t14-20020a05600c198e00b003cfd4a50d5asm7387447wmq.34.2022.12.09.00.07.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Dec 2022 00:07:45 -0800 (PST) Message-ID: <6209d614-b1f2-4501-6b8a-6d4095c309eb@redhat.com> Date: Fri, 9 Dec 2022 09:07:44 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH v1] mm/userfaultfd: enable writenotify while userfaultfd-wp is enabled for a VMA To: Peter Xu Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Ives van Hoorne , stable@vger.kernel.org, Andrew Morton , Hugh Dickins , Alistair Popple , Mike Rapoport , Nadav Amit , Andrea Arcangeli References: <20221208114137.35035-1-david@redhat.com> Content-Language: en-US From: David Hildenbrand Organization: Red Hat In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham 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 08.12.22 21:21, Peter Xu wrote: > On Thu, Dec 08, 2022 at 03:06:06PM -0500, Peter Xu wrote: >> On Thu, Dec 08, 2022 at 05:44:35PM +0100, David Hildenbrand wrote: >>> I'll wait for some more (+retest) before I resend tomorrow. >> >> One more thing just to double check: >> >> It's 6a56ccbcf6c6 ("mm/autonuma: use can_change_(pte|pmd)_writable() to >> replace savedwrite", 2022-11-30) that just started to break uffd-wp on >> numa, am I right? >> >> With the old code, pte_modify() will persist uffd-wp bit, afaict, and we >> used to do savedwrite for numa hints. That all look correct to me until >> the savedwrite removal patchset with/without vm_page_prot changes. >> >> If that's the case, we'd better also mention that in the commit message and >> has another Fixes: for that one to be clear. > > Nah, never mind. I think the savedwrite will not guarantee pte write > protected just like the migration path. The commit message is correct. Right, the problem is not the uffd-wp bit getting lost, but the write bit getting set, which is independent of 6a56ccbcf6c6. Thanks for double-checking 6a56ccbcf6c6. -- Thanks, David / dhildenb