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 31148C433EF for ; Fri, 17 Dec 2021 20:56:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AE3716B0071; Fri, 17 Dec 2021 15:55:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A927A6B0073; Fri, 17 Dec 2021 15:55:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 95A0E6B0074; Fri, 17 Dec 2021 15:55:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0042.hostedemail.com [216.40.44.42]) by kanga.kvack.org (Postfix) with ESMTP id 877666B0071 for ; Fri, 17 Dec 2021 15:55:50 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 54E66180BD9D5 for ; Fri, 17 Dec 2021 20:55:40 +0000 (UTC) X-FDA: 78928492440.18.2EE915A Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf07.hostedemail.com (Postfix) with ESMTP id E9E5940049 for ; Fri, 17 Dec 2021 20:55:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1639774539; 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=gt0DtLTTM3E0C5XUm2JmJz4pNU1PDieeF6+dQqYh0XM=; b=fxL/3KU80an27dPD4irGlzchE2t4TBIvi9s7G77nI9Zct+l8TuaSC9+2ftOG6v0GUi1qm/ 3Kbrok7PxhXZfLkVa/j0Mk0DySw6xa7rlY9yqlX4qgUdQwwQpKHDM5P/1cq3G096m4cOoN fpap1bPb0iuWHu4/AHskVfRxERPoRYk= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-128-Q1ixmwGaNa6pL-GGi9YCcg-1; Fri, 17 Dec 2021 15:55:38 -0500 X-MC-Unique: Q1ixmwGaNa6pL-GGi9YCcg-1 Received: by mail-wm1-f70.google.com with SMTP id r10-20020a1c440a000000b003456b2594e0so1219448wma.8 for ; Fri, 17 Dec 2021 12:55:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=gt0DtLTTM3E0C5XUm2JmJz4pNU1PDieeF6+dQqYh0XM=; b=Q9wHIVTDRWesc0rp7n8qIqW3hFjlRCd7F7huIwK8xPAunABhP8yUDe0NFUsSvU/vv8 9HclIa0YiDQS/U89nu4qxvOmcc4hNKJMvbnTWPy32ZoYvFHOMLTMQhtGZTlCKWLg8pvF ZP+ZO75hxTB/441Cn8rsaULEChTK2dfEAK20DAEDG0e2eUViqD+6y66DCOaJw9r0Un2r 4JHDowuheybYpdXjnYagRhtq6vnPjWPfoBLARV8C5bUHEHtSgCVLoKAENPxHT7RX7Sj4 i3WSLmFVju5quf+I8XW8imDannvjbCsFo85h0jNCt+3oo3E+ClsKaoYyPtTfDJyaozow fTNA== X-Gm-Message-State: AOAM533Qn5C8ApxQfL1FMgL9z9BS81Ac74A6LsCbw4V+WzCe7BPSglqQ VQVmaOUYX9g+d9ZpvUs8BWvGiFGg056d2gVv/r6/BFWevc6KIFs3O2i3xfbkQC8T4vwFG3bw/8b Loh5h1458mos= X-Received: by 2002:a1c:9d55:: with SMTP id g82mr9036005wme.58.1639774536975; Fri, 17 Dec 2021 12:55:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJy2VIGy81gYhcxxwp937rzdgjfMqRdg6hjw0UIMF9SiLBF1P2rxY4ZqXf8403kKG7hOqOFIcw== X-Received: by 2002:a1c:9d55:: with SMTP id g82mr9035975wme.58.1639774536777; Fri, 17 Dec 2021 12:55:36 -0800 (PST) Received: from [192.168.3.132] (p4ff234b8.dip0.t-ipconnect.de. [79.242.52.184]) by smtp.gmail.com with ESMTPSA id s189sm9283243wme.0.2021.12.17.12.55.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 17 Dec 2021 12:55:36 -0800 (PST) Message-ID: Date: Fri, 17 Dec 2021 21:55:33 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH v1 06/11] mm: support GUP-triggered unsharing via FAULT_FLAG_UNSHARE (!hugetlb) To: Linus Torvalds Cc: Linux Kernel Mailing List , Andrew Morton , Hugh Dickins , David Rientjes , Shakeel Butt , John Hubbard , Jason Gunthorpe , Mike Kravetz , Mike Rapoport , Yang Shi , "Kirill A . Shutemov" , Matthew Wilcox , Vlastimil Babka , Jann Horn , Michal Hocko , Nadav Amit , Rik van Riel , Roman Gushchin , Andrea Arcangeli , Peter Xu , Donald Dutile , Christoph Hellwig , Oleg Nesterov , Jan Kara , Linux-MM , "open list:KERNEL SELFTEST FRAMEWORK" , "open list:DOCUMENTATION" References: <20211217113049.23850-1-david@redhat.com> <20211217113049.23850-7-david@redhat.com> <9c3ba92e-9e36-75a9-9572-a08694048c1d@redhat.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: E9E5940049 X-Stat-Signature: 1iu7ugii6yfg79uechdzptfqckca69nd Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="fxL/3KU8"; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf07.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=david@redhat.com X-Rspamd-Server: rspam11 X-HE-Tag: 1639774539-84142 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 17.12.21 21:51, Linus Torvalds wrote: > On Fri, Dec 17, 2021 at 12:45 PM David Hildenbrand wrote: >> >> If a page is mapped exactly once, page_mapcount(page) == 1 and there is >> nothing to do. > > Why? > > You state that, but you stating that doesn't magically make it so. > > What makes "mapcount==1" stable and special? Your "it's an > atomic_read()" argument is nonsense - it implies that the count can be > changing, but you will get _one_ answer. And I explained how it can not increment. And the only way is via fork(), which cannot run concurrently. > > What makes that one answer of a changing count special? > > What if there are other references to that same page, gotten with > vmsplice(), and just about to be mapped into another address space? If we have a shared anonymous page we cannot have GUP references, not even R/O ones. Because GUP would have unshared and copied the page, resulting in a R/O mapped anonymous page. What am I missing? -- Thanks, David / dhildenb