Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3405395rdh; Thu, 28 Sep 2023 10:34:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFPsrogIvogo8Z+8WR9eWf7hCM2qipxUAQ+xxhUpbq0FSDMdydNSmdvkV5LEN3pmANDiojt X-Received: by 2002:a17:90a:f2d5:b0:26b:280b:d24c with SMTP id gt21-20020a17090af2d500b0026b280bd24cmr1694581pjb.42.1695922473108; Thu, 28 Sep 2023 10:34:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695922473; cv=none; d=google.com; s=arc-20160816; b=QTCITxpdqcJnxvuQVicjEI+CPM+PgLo3Lea112X1iOE/I6VTyXhBTnSOZMfr5x/W14 /rqcFBzY7D3X6JgvQ4ZJDKi466XRoZC2HznxKfQlCNgxmZnzJmZK7GUw8YVXr9kYjW+a QCCUd5aZISuOiGCwfz2d7yF6uH3Q9VmGYzBvOYbT4E5vIiafU3kJ5uYkIanNsLtYn6Km nWJidj2Ugn9MGk8xUOZ53HmPHFBlifgK2ZNMKCT1h5S5N8wByVcRa5CxQ2gt9bmbm7xE Cj58h9ridI/YVobXkWWieepZZBcI4u6o4vaUf/stF6E27AggAO7WH8JspAQRB/4Y8gYH hZjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ndiSQPUClBTrz4CKUdDdf3vxdcFaBznOakZY24ftqF0=; fh=3XYCKbGtpDXdT2CCOIcKMaEb8y1IHgwSi0yoJXDWSeg=; b=RG3aBWK+OhFSJgqy2/LKnPwwrlnXXpnDQNGKgyNGEV8OQUnMaIV7Gadxm9Bv/JQ4eA SqJKN4V7ot+h10VSCqIazxHAc5tns6lMM2ZWXsyQif19XFT3yeVkM6mEmBSlkcDE6J2L wandDfQUxcquvOCM0bf3XD9yv9t7j1Jx6pkyAOZIzXZusco/TvfVXq0XikUqgAboTwuV J02MzRWlwVQ0fX1s69mR+0KOn+nIVB3Dv5tkMZVkuEbv32HfsqvUayFWHaKBp/u1YYLo XY8sb8eSmZTJfZys47iPNiIkSOOWQdXZK6KfMQWCTv7aGyzI9XE2NM9XlpxOA7ZF6Kru wmLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FCMxENEG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id lx15-20020a17090b4b0f00b00279016a2a2asi5101414pjb.135.2023.09.28.10.34.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 10:34:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FCMxENEG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 6E06D80BD536; Thu, 28 Sep 2023 09:26:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231529AbjI1QZx (ORCPT + 99 others); Thu, 28 Sep 2023 12:25:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231415AbjI1QZt (ORCPT ); Thu, 28 Sep 2023 12:25:49 -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 29EDB1A1 for ; Thu, 28 Sep 2023 09:25:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695918300; 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=ndiSQPUClBTrz4CKUdDdf3vxdcFaBznOakZY24ftqF0=; b=FCMxENEGxglT6ftwEJ/kZ57h+dED+OFVDkGNb3T0K6wuZK89DLJZXq8E4RbZ4CUWoOwnRu zHHdY5oLJgvOjjB/fk9WW4VSgWnOHVVPMGiDQ97ZcxmalWgwWibuUKlAgJO741eyruJnSj hd9mJtnZT0C91J7RX/lD+ZumdmNCCFE= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-398-84LkYUHhMXOfCVsJci29gA-1; Thu, 28 Sep 2023 12:24:57 -0400 X-MC-Unique: 84LkYUHhMXOfCVsJci29gA-1 Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-41810d0d8c2so36997991cf.1 for ; Thu, 28 Sep 2023 09:24:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695918296; x=1696523096; 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=ndiSQPUClBTrz4CKUdDdf3vxdcFaBznOakZY24ftqF0=; b=GrpsFG6Sc4/ftja7uQRPyIpw6qs/7UMgKtkIh9hh0VCZYRBFzyMIApMJLqOsImO3E5 IgJ5OcLLC/cQ2y1kQmpMDoIS12ccZKelHbHDlle4vIri6c8PvNFXAv/vxfL8kZOHIkai qk7OBmDtrcre2zZ34LAWZycucMbiCpFLPUJYq/FfryNXgoZrAuA6wL76ziREPgOjhBLG tKCYw6/HOg18zXtDgb3ebi56CQ4LKugepfsoSOfvUw8RYgk8axwL2Z5f1zinDwsGtFUp /AXrZGThm+4sSU03QwYPXqiUu6b8GvQl2huNzQh9GtLlkdKvIinCmcSmAJQ+0LkqBk0C Jd2g== X-Gm-Message-State: AOJu0YwkMxR0ezlocBNjzGF5umBd4g9Yp7KMoyACTOyt+q70326ZNz8O pT/wxZXVYyQ1ya8wtbO9DdjUw6/nHM53OecmjEJ8G5Lk6O6MVL1BLvgC0eDb8G1UVUWcUFF54Ko /EogIXnCP91nQ8v2Wc2mj13ql X-Received: by 2002:a05:622a:1a27:b0:418:f2a:c223 with SMTP id f39-20020a05622a1a2700b004180f2ac223mr1920012qtb.1.1695918296714; Thu, 28 Sep 2023 09:24:56 -0700 (PDT) X-Received: by 2002:a05:622a:1a27:b0:418:f2a:c223 with SMTP id f39-20020a05622a1a2700b004180f2ac223mr1919998qtb.1.1695918296376; Thu, 28 Sep 2023 09:24:56 -0700 (PDT) Received: from x1n (cpe5c7695f3aee0-cm5c7695f3aede.cpe.net.cable.rogers.com. [99.254.144.39]) by smtp.gmail.com with ESMTPSA id c25-20020ac86619000000b004195faf1e2csm1154119qtp.97.2023.09.28.09.24.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 09:24:56 -0700 (PDT) Date: Thu, 28 Sep 2023 12:24:53 -0400 From: Peter Xu To: David Hildenbrand 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 Subject: Re: [PATCH v2 2/3] userfaultfd: UFFDIO_REMAP uABI Message-ID: References: <20230923013148.1390521-1-surenb@google.com> <20230923013148.1390521-3-surenb@google.com> <03f95e90-82bd-6ee2-7c0d-d4dc5d3e15ee@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <03f95e90-82bd-6ee2-7c0d-d4dc5d3e15ee@redhat.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 agentk.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 (agentk.vger.email [0.0.0.0]); Thu, 28 Sep 2023 09:26:38 -0700 (PDT) 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? Thanks, -- Peter Xu