Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3597005rdh; Thu, 28 Sep 2023 17:26:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGVsWbO41i1s6AhP62nfaAvJfzHcuK4nDsUbozA+KVsMxfBXWs8dFNLsLt+iDr9rcsXEDYB X-Received: by 2002:a05:6a00:2d01:b0:690:2ecd:a599 with SMTP id fa1-20020a056a002d0100b006902ecda599mr2941186pfb.21.1695947215910; Thu, 28 Sep 2023 17:26:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695947215; cv=none; d=google.com; s=arc-20160816; b=zm5yDqCWKJNjIr2pQCnjdv0ZrDNylvbzGOhQpxcg7mYPOY5pwelNNcnWf8oToljQO3 MMwbrwfc/vFVW6d/LFFBR11f6N45YQ7jGXWxhVZmmyuEmYOv/OL1uqMus8h6NI7ENjqI F3q44POgMpBGxn6MyavweMsOOvU4QM+Js04A4NTkTXCTDYCCN1i9QAqeHbCevEmvS44b GuxYSoAQhXCs6Om9MRTS4lZSu0m1YKTbzfpPu3toAjifbUzlazlB2a5Hs4jLq0NLB03d webCsKccOztjbZSIM2PP5eqhsFu863w0FZUU6/mIgZCqp9MPfra6KHEnbXljiL/zBSYM mrDA== 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=o5/wGCofixZwvi3PH41gwKcB6yNjtyo8RsF8JyFJAyM=; fh=MDU24jSgRWQwNFl40U2PL4F4FDBGL7b/QeWQPYWwNyo=; b=GHiDHAuHVNcpZOQgASG1sp7ibEGo66KWeOhPqfsPzYPBUnVGUm1ydjnQBZd4KhWzLl l+8mObXW3Cq+SI5HZ8yEji+6yDSyO6xTRGaaEivfe8bQUKlKAHRm+HGlu4lscE3fCNUs GLdCGfIdtjCn6uWc56kvEcg+f0d9d58ohutZiRMWESl/223iLiiIqxHBoxHfANQrBSmX NBAjp5gl8AGkIk78FBZjHkI+iH5SdP5GYC09mIQ/sbiyKvQgf3XChh82uQ/mDTr4UX7/ iHIMOB1mwXqpPKtmiI3jk1hU95L/PxKFGjMMeQu386EJxeMg7ScP27QSoaAsd3R1wc2W jKlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PkyzW4eN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id eb2-20020a056a004c8200b00690fe0f6e0dsi19890774pfb.68.2023.09.28.17.26.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 17:26:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PkyzW4eN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 2EEB680BEDE5; Thu, 28 Sep 2023 10:07:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232053AbjI1RGs (ORCPT + 99 others); Thu, 28 Sep 2023 13:06:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231936AbjI1RGe (ORCPT ); Thu, 28 Sep 2023 13:06:34 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF09AC0 for ; Thu, 28 Sep 2023 10:05:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695920746; 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=o5/wGCofixZwvi3PH41gwKcB6yNjtyo8RsF8JyFJAyM=; b=PkyzW4eNv7lpI0ULHb79voDVAX1m4YYXtEgohyUXIm2je8/rr5QJk1oEAm1dhv4d8BeEUH /6V3LlFsBXEfpJI6FpuHGbmmuzYx//DvsdnSwT9h1VuFyTc6g/3Jo0248QglTa65q2gTWj 98RLDAS+FrXGIVl5nmkm/aRX4ajnORA= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-638-_2pIknzxMBCR5NCr_Gmd4Q-1; Thu, 28 Sep 2023 13:05:44 -0400 X-MC-Unique: _2pIknzxMBCR5NCr_Gmd4Q-1 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-315af0252c2so10584239f8f.0 for ; Thu, 28 Sep 2023 10:05:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695920743; x=1696525543; 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=o5/wGCofixZwvi3PH41gwKcB6yNjtyo8RsF8JyFJAyM=; b=gHTvMI4XNqShjryvpj0Jsdaorw6WxFUF7E4EAXpVEXF79CZAJ5hIgnelKc4CslIQ0v if2lnQVI/eJzHXp4OU59ZgLTJV6gYPhv1DxWu6Nde+mPlOFv22uigsergtsxCotpuiCW T4zKw2qIvF8N88D/pUA8r8Z6knGHG1LtpyLTXWYQpTMdmyMDC7yq03iA3ixVbeMuJNoc IzTu8nw93hOt+JUo9ipIp3jGWCzuoYFMf5jst7ZM4sdnjhD1KWSDBSc8iLq8i5y5IxRx XVRNTy0MadzJgB78newh3JhycHw8SXAlSfh+38T4Vigc8ibR+vvtUnbeinZ4oY62vUMx 93wA== X-Gm-Message-State: AOJu0YwFKSUL1kQZ6uAdf2Sr6sDvHbn1294j2r1WDl0Az8QfSM6JjHyA t8NAx6nXcDnLjfQgTgST2Ov0D7coIAB3m2miY5zNFaZhTrdQThL6PzXdU02aSeDGic7jXLMXEa9 F4CYSC5jHDW7BnQ/Pj7Pip8Ik X-Received: by 2002:adf:ce8b:0:b0:321:66a5:4da4 with SMTP id r11-20020adfce8b000000b0032166a54da4mr1829451wrn.2.1695920742807; Thu, 28 Sep 2023 10:05:42 -0700 (PDT) X-Received: by 2002:adf:ce8b:0:b0:321:66a5:4da4 with SMTP id r11-20020adfce8b000000b0032166a54da4mr1829421wrn.2.1695920742351; Thu, 28 Sep 2023 10:05:42 -0700 (PDT) Received: from [192.168.3.108] (p5b0c6ff2.dip0.t-ipconnect.de. [91.12.111.242]) by smtp.gmail.com with ESMTPSA id y5-20020adfd085000000b003217c096c1esm907619wrh.73.2023.09.28.10.05.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 28 Sep 2023 10:05:41 -0700 (PDT) Message-ID: <98b21e78-a90d-8b54-3659-e9b890be094f@redhat.com> Date: Thu, 28 Sep 2023 19:05:40 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v2 2/3] userfaultfd: UFFDIO_REMAP uABI To: Peter Xu Cc: Jann Horn , Suren Baghdasaryan , akpm@linux-foundation.org, viro@zeniv.linux.org.uk, brauner@kernel.org, shuah@kernel.org, aarcange@redhat.com, lokeshgidra@google.com, hughd@google.com, mhocko@suse.com, axelrasmussen@google.com, rppt@kernel.org, willy@infradead.org, Liam.Howlett@oracle.com, zhangpeng362@huawei.com, bgeffon@google.com, kaleshsingh@google.com, ngeoffray@google.com, jdduke@google.com, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kernel-team@android.com References: <20230923013148.1390521-1-surenb@google.com> <20230923013148.1390521-3-surenb@google.com> <03f95e90-82bd-6ee2-7c0d-d4dc5d3e15ee@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.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 28 Sep 2023 10:07:00 -0700 (PDT) On 28.09.23 18:24, Peter Xu wrote: > On Wed, Sep 27, 2023 at 03:29:35PM +0200, David Hildenbrand wrote: >>>> + if (!pte_same(*src_pte, orig_src_pte) || >>>> + !pte_same(*dst_pte, orig_dst_pte) || >>>> + folio_test_large(src_folio) || >>>> + folio_estimated_sharers(src_folio) != 1) { >> >> ^ here you should check PageAnonExclusive. Please get rid of any implicit >> explicit/implcit mapcount checks. > > David, is PageAnon 100% accurate now in the current tree? > > IOW, can it be possible that the page has total_mapcount==1 but missing > AnonExclusive bit in any possible way? As described as reply to v1, without fork() and KSM, the PAE bit should stick around. If that's not the case, we should investigate why. If we ever support the post-fork case (which the comment above remap_pages() excludes) we'll need good motivation why we'd want to make this overly-complicated feature even more complicated. -- Cheers, David / dhildenb