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 2F461C433EF for ; Fri, 17 Dec 2021 20:52:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A72076B0071; Fri, 17 Dec 2021 15:52:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A21706B0073; Fri, 17 Dec 2021 15:52:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8C2A16B0074; Fri, 17 Dec 2021 15:52:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0152.hostedemail.com [216.40.44.152]) by kanga.kvack.org (Postfix) with ESMTP id 79A796B0071 for ; Fri, 17 Dec 2021 15:52:02 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 3DF4D181AC9C6 for ; Fri, 17 Dec 2021 20:51:52 +0000 (UTC) X-FDA: 78928482864.01.C406D3F Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) by imf12.hostedemail.com (Postfix) with ESMTP id 4FAF440038 for ; Fri, 17 Dec 2021 20:51:43 +0000 (UTC) Received: by mail-ed1-f53.google.com with SMTP id y13so12361358edd.13 for ; Fri, 17 Dec 2021 12:51:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TG2f+1lEN9hemuQjgMe4Yp+YI3NU/6U4WSw8/cJzPxw=; b=Yrgcl5joP5IKSH1feNkTltzJLVVG8zrXENqo7vUe3EVV9XknZ07REOeQRBojTzTO86 ru0XQjTptmuCTBKHvUxnc0k1m5boTQTeFASvq7tIIKB6yCjG9+KF1TpJp2uSt5cPlXfQ mvyq0AjNx+7bb2we1uo6ifMBNTtiDYvBUnRhg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TG2f+1lEN9hemuQjgMe4Yp+YI3NU/6U4WSw8/cJzPxw=; b=mwyc038FQ8RBD1PTzvZ0w9CSmi/FGxjCONaKgUMQJS9tLgBAOIHbC4ebx61kQ8b4Bz J2OLaMJVubPC8omarte2S20OWa7Rp9cGTcZcVvBq3v6zMAoHvT0UxQfZH28iDesZJEy/ 9AYkck7jks+8nRKU5HGQdticFo0JWovz48stuTGWpeCSH63Hnck2luK07q4R40X5orp/ 1tpJ+sMk0JUQn5aQMX8kD0/mYNKqi3DqKgnPlpFKbUd/71ba6WD5eHU/M32k00mbDZUu OC5qxRM3kXUAf7X+2Qpc6QJY/maIJX/qEbXncv95I6XqeasuHqvjarbyKwAsQRmU0YF/ d38A== X-Gm-Message-State: AOAM532xHuRDGzANHP9c/q2Fr6ivKeN7wFeCK7/OhE7nJFsM7m1pVNOB nj/xvkd5k5+07mVtgV7SZy8YTibmVcOiCdqFtxM= X-Google-Smtp-Source: ABdhPJxoLVHFUKWn68DvfUHZ1nppy1dWqZnqmLR1M3rMcTR+W3pSWljj71KypVXJ4jWcce5l2yXnYw== X-Received: by 2002:a17:907:9691:: with SMTP id hd17mr4042694ejc.607.1639774310497; Fri, 17 Dec 2021 12:51:50 -0800 (PST) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com. [209.85.128.49]) by smtp.gmail.com with ESMTPSA id 4sm3132116ejc.160.2021.12.17.12.51.49 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 17 Dec 2021 12:51:50 -0800 (PST) Received: by mail-wm1-f49.google.com with SMTP id z4-20020a1c7e04000000b0032fb900951eso4867202wmc.4 for ; Fri, 17 Dec 2021 12:51:49 -0800 (PST) X-Received: by 2002:a05:600c:1914:: with SMTP id j20mr11082980wmq.26.1639774298625; Fri, 17 Dec 2021 12:51:38 -0800 (PST) MIME-Version: 1.0 References: <20211217113049.23850-1-david@redhat.com> <20211217113049.23850-7-david@redhat.com> <9c3ba92e-9e36-75a9-9572-a08694048c1d@redhat.com> In-Reply-To: <9c3ba92e-9e36-75a9-9572-a08694048c1d@redhat.com> From: Linus Torvalds Date: Fri, 17 Dec 2021 12:51:22 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v1 06/11] mm: support GUP-triggered unsharing via FAULT_FLAG_UNSHARE (!hugetlb) To: David Hildenbrand 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" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4FAF440038 X-Stat-Signature: 8iajguudfpngwh8jde71udapoxerft87 Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b=Yrgcl5jo; spf=pass (imf12.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.208.53 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org; dmarc=none X-Rspamd-Server: rspam10 X-HE-Tag: 1639774303-264128 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 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. 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? This is the meat of my argument. You claim that "mapcount==1" is special. I claim that you haven't explained why it would be. And I do not believe it is. Linus