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 X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78C29C433E0 for ; Thu, 7 Jan 2021 22:19:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 50C1B23600 for ; Thu, 7 Jan 2021 22:19:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728093AbhAGWSt (ORCPT ); Thu, 7 Jan 2021 17:18:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727344AbhAGWSt (ORCPT ); Thu, 7 Jan 2021 17:18:49 -0500 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78594C0612F6 for ; Thu, 7 Jan 2021 14:18:08 -0800 (PST) Received: by mail-lf1-x131.google.com with SMTP id o13so18369796lfr.3 for ; Thu, 07 Jan 2021 14:18:08 -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=+47eR4Bwm2fUxRCzNw86b57GLxJUQgbaI393M/TdOC8=; b=VmzVoiO3iotOwKySTBYAbz22Cy0Mz1M2+2vk7cNz/0XZWWy9tIlfo7DJYlzHkwuF66 JtSjlpK8HozPLFXsFYnF4DBLEW4G5OpBIWOhnY3wYJYGWCh+m+Tl0yv4PpdhrumsQ1dw ZszWwE/+nX4+2OPhkN4l6OSxeFMavhs9u4VmM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+47eR4Bwm2fUxRCzNw86b57GLxJUQgbaI393M/TdOC8=; b=lkXUtrW8VcBGKQJuvnv2A7mJC674f9H2bgITrljjqkrAw3IeuPO3h2GYQJqhA2bn5M rpOQ2PS8sPD2aHiGA4y2dMVUap9loQZ1gRY/Yw9nuKGFkCvvmnRWA35nkHycD5T4faps /W8wkaKs1W9j1v58Bti0WcFhSMmiHDoXCaL52+zFHcNwx5osQKqUNEyklSOVFurJMfWT r70FoeO76Vl/A5IZb+WeD+5SkY0PdxdBJ6j7IbvpIa6RAc9KCHLOqmF1HtZ/+nTexrJP q3Y7RpH7fFBvilLcQfXye7W8LChdmA1/F7CJU1A4sMnD3zNzD3tdZyt9pdqhkHFsnaE3 Xp+w== X-Gm-Message-State: AOAM532hWDeOHHGdEOe/2CRY4MUenslFVuriPmLdVoGCi0RP2TUr1mv5 c7iWtjJ9txupMcUgcd0AC/Tl2Dg72qmUoA== X-Google-Smtp-Source: ABdhPJztt6SgUzZg4uV+8gwDze1g3+p7D2scTyH9ymM6HM9YfX5VH3HWZB3FvL4ABTGTFD9vsWZK3A== X-Received: by 2002:ac2:4e8d:: with SMTP id o13mr335613lfr.259.1610057887055; Thu, 07 Jan 2021 14:18:07 -0800 (PST) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com. [209.85.167.44]) by smtp.gmail.com with ESMTPSA id w202sm1455281lff.182.2021.01.07.14.18.06 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Jan 2021 14:18:06 -0800 (PST) Received: by mail-lf1-f44.google.com with SMTP id l11so18413603lfg.0 for ; Thu, 07 Jan 2021 14:18:06 -0800 (PST) X-Received: by 2002:a2e:9ad7:: with SMTP id p23mr213490ljj.465.1610057885956; Thu, 07 Jan 2021 14:18:05 -0800 (PST) MIME-Version: 1.0 References: <20210107200402.31095-1-aarcange@redhat.com> <20210107202525.GD504133@ziepe.ca> In-Reply-To: From: Linus Torvalds Date: Thu, 7 Jan 2021 14:17:50 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/2] page_count can't be used to decide when wp_page_copy To: Andrea Arcangeli Cc: Jason Gunthorpe , Linux-MM , Linux Kernel Mailing List , Yu Zhao , Andy Lutomirski , Peter Xu , Pavel Emelyanov , Mike Kravetz , Mike Rapoport , Minchan Kim , Will Deacon , Peter Zijlstra , Hugh Dickins , "Kirill A. Shutemov" , Matthew Wilcox , Oleg Nesterov , Jann Horn , Kees Cook , John Hubbard , Leon Romanovsky , Jan Kara , Kirill Tkhai Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 7, 2021 at 2:03 PM Andrea Arcangeli wrote: > > If you could stop mentioning UFFDIO_WRITEPROTECT and only focus on > softdirty/clear_refs, maybe you wouldn't think my judgment is biased > towards clear_refs/softdirty too. So I think we can agree that even that softdirty case we can just handle by "don't do that then". if a page is pinned, the dirty bit of it makes no sense, because it might be dirtied complately asynchronously by the pinner. So I think none of the softdirty stuff should touch pinned pages. I think it falls solidly under that "don't do it then". Just skipping over them in clear_soft_dirty[_pmd]() doesn't look that hard, does it? Linus 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 X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25A6BC433DB for ; Thu, 7 Jan 2021 22:18:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AA7D123600 for ; Thu, 7 Jan 2021 22:18:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AA7D123600 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 167DC8D0155; Thu, 7 Jan 2021 17:18:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0F1B18D0150; Thu, 7 Jan 2021 17:18:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EFB088D0155; Thu, 7 Jan 2021 17:18:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0130.hostedemail.com [216.40.44.130]) by kanga.kvack.org (Postfix) with ESMTP id D6B908D0150 for ; Thu, 7 Jan 2021 17:18:10 -0500 (EST) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 9CF41181AEF0B for ; Thu, 7 Jan 2021 22:18:10 +0000 (UTC) X-FDA: 77680393140.20.boat97_41164cb274ed Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id 7FA5E180C07AB for ; Thu, 7 Jan 2021 22:18:10 +0000 (UTC) X-HE-Tag: boat97_41164cb274ed X-Filterd-Recvd-Size: 4822 Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) by imf08.hostedemail.com (Postfix) with ESMTP for ; Thu, 7 Jan 2021 22:18:09 +0000 (UTC) Received: by mail-lf1-f54.google.com with SMTP id m12so18313155lfo.7 for ; Thu, 07 Jan 2021 14:18:09 -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=+47eR4Bwm2fUxRCzNw86b57GLxJUQgbaI393M/TdOC8=; b=VmzVoiO3iotOwKySTBYAbz22Cy0Mz1M2+2vk7cNz/0XZWWy9tIlfo7DJYlzHkwuF66 JtSjlpK8HozPLFXsFYnF4DBLEW4G5OpBIWOhnY3wYJYGWCh+m+Tl0yv4PpdhrumsQ1dw ZszWwE/+nX4+2OPhkN4l6OSxeFMavhs9u4VmM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+47eR4Bwm2fUxRCzNw86b57GLxJUQgbaI393M/TdOC8=; b=eBCm7cCtBlXclBDdY16sQAPkNYI+umqou33L9qGQ1ot7Sry5ucazo9yYbfD5csXfWj cP+49E0xsWptUu3zLbqJAC98o84VqIl8bxrQsdSKST4C1OFoRI6C74hFBQ7b/hG/2shS S4qJdUeGUp8C9/kQT7PFnODfpVHWG6EUoRtVf3a6tG/SN059JcdgLN+sg5a1INRKNZkk 9N5rOpekPV0OunMM5JxUz6CsKKa4RAIwVSswYdXRX1UU5uHu29WY9aktZNHbeX2HMBF9 UPHsfPrNx57civG3YFeQyjjMeidVmTQdc+Pji2ButbHFqZexODTsFrQb7ODAojA+//re 1Sxw== X-Gm-Message-State: AOAM5304So0l8DuMHwkjpkIBJ9RTZ3LpaN1wnxJSMAfKWx4A0V9m8KeA AC28tDdROT26Rk4zlfa6g7TYuPpIN0wk2g== X-Google-Smtp-Source: ABdhPJwIttnzUj2aX0vdPZJXZMbHrSluf4E/EbFuDLVpsgUCyQioUbzRZF3P1/bX0T90NY2k+Nj7Jg== X-Received: by 2002:a19:8983:: with SMTP id l125mr342135lfd.182.1610057887997; Thu, 07 Jan 2021 14:18:07 -0800 (PST) Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com. [209.85.167.47]) by smtp.gmail.com with ESMTPSA id m7sm1440332lfb.146.2021.01.07.14.18.06 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Jan 2021 14:18:06 -0800 (PST) Received: by mail-lf1-f47.google.com with SMTP id o13so18369644lfr.3 for ; Thu, 07 Jan 2021 14:18:06 -0800 (PST) X-Received: by 2002:a2e:9ad7:: with SMTP id p23mr213490ljj.465.1610057885956; Thu, 07 Jan 2021 14:18:05 -0800 (PST) MIME-Version: 1.0 References: <20210107200402.31095-1-aarcange@redhat.com> <20210107202525.GD504133@ziepe.ca> In-Reply-To: From: Linus Torvalds Date: Thu, 7 Jan 2021 14:17:50 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/2] page_count can't be used to decide when wp_page_copy To: Andrea Arcangeli Cc: Jason Gunthorpe , Linux-MM , Linux Kernel Mailing List , Yu Zhao , Andy Lutomirski , Peter Xu , Pavel Emelyanov , Mike Kravetz , Mike Rapoport , Minchan Kim , Will Deacon , Peter Zijlstra , Hugh Dickins , "Kirill A. Shutemov" , Matthew Wilcox , Oleg Nesterov , Jann Horn , Kees Cook , John Hubbard , Leon Romanovsky , Jan Kara , Kirill Tkhai Content-Type: text/plain; charset="UTF-8" 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 Thu, Jan 7, 2021 at 2:03 PM Andrea Arcangeli wrote: > > If you could stop mentioning UFFDIO_WRITEPROTECT and only focus on > softdirty/clear_refs, maybe you wouldn't think my judgment is biased > towards clear_refs/softdirty too. So I think we can agree that even that softdirty case we can just handle by "don't do that then". if a page is pinned, the dirty bit of it makes no sense, because it might be dirtied complately asynchronously by the pinner. So I think none of the softdirty stuff should touch pinned pages. I think it falls solidly under that "don't do it then". Just skipping over them in clear_soft_dirty[_pmd]() doesn't look that hard, does it? Linus