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 4124AC433E9 for ; Mon, 11 Jan 2021 15:53:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E844522A83 for ; Mon, 11 Jan 2021 15:53:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388594AbhAKPxc (ORCPT ); Mon, 11 Jan 2021 10:53:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727996AbhAKPx2 (ORCPT ); Mon, 11 Jan 2021 10:53:28 -0500 Received: from mail-qv1-xf2d.google.com (mail-qv1-xf2d.google.com [IPv6:2607:f8b0:4864:20::f2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA475C061794 for ; Mon, 11 Jan 2021 07:52:47 -0800 (PST) Received: by mail-qv1-xf2d.google.com with SMTP id h16so7575067qvu.8 for ; Mon, 11 Jan 2021 07:52:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=DTtX5CQ79mvCElDxODO77cVTuyuq22GdoAJZjW803s4=; b=PP5P9Js+hVVOM2eTY6pAKi4aMnJ/nRqExT3Coc1R4TFDgp6o81GIvIAF45yGnE5EdU n/S/92pNpsBAj2aX5b/s4lAozrka3jVUmUIGgnoqI+ZX9dCIfwYhxNHy4b5vtKSKsAE0 mgMRxsb5f2T4K+xe2zmXwStNx17ucbYwtLOZxxPNl00kCpj5n15TLGNq0J8QrCyIuOaK btbXvNMhsVa1pl6NvWQwlaq4KuScx/2dlraYITujsK5duvl9f8itQxUw8TDMmwMGOeBE xEU0jAEkUHuScctGS4ZMweae+n8CLHQ+VgnGf4j3jJWZEe5QbyyhAva/ECM9vKEUyfns e3UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=DTtX5CQ79mvCElDxODO77cVTuyuq22GdoAJZjW803s4=; b=jCFk68BjvLyZ8wrabmjReEuJg4+YbUJc81+LfZQcFmEtgBprP8l9j1mBxJQNYlZsEw JIwhhZ7XEeyuzWadutdpWi63Y4BNagFhXKkvOM/3MPp8ef8e+au+2/atSulPYgSwHG84 7SJ/WhLj/kVGAk0Gm9E2gax56/YGWwOUTQJZ8EBK7WObz4Re3N76aR9sa7dDRnmI5KtU VrHm7jGgeliE634gE6KDtIRrr5oKAjGNRth97lAdCDuyjJ9CFEk0aI5rSFM2joWhaZ6b BzkDcqf3IdrXDIePanmTViX+IZb5uWgSu3ptHVJx9y/DZEVjKd7s1JnPdwwlRbBPa3md 6Jzg== X-Gm-Message-State: AOAM5315AGUJU/3CVP0EtL9qPB75dyotItCx1PmjiMqqnH6bhgjbBat8 s+RlA9xroapRfqmzldRjNtMMaA== X-Google-Smtp-Source: ABdhPJyKYjAT3LmoVbBTtIHwrAxf+Io6skqOJi1oDcms79ORoN0cLhj8cmluyb8xaWTDdeJLBNsZAw== X-Received: by 2002:a05:6214:14af:: with SMTP id bo15mr249528qvb.19.1610380367039; Mon, 11 Jan 2021 07:52:47 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-162-115-133.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.115.133]) by smtp.gmail.com with ESMTPSA id r6sm67695qkk.127.2021.01.11.07.52.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jan 2021 07:52:46 -0800 (PST) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kyzUr-005YBj-Kq; Mon, 11 Jan 2021 11:52:45 -0400 Date: Mon, 11 Jan 2021 11:52:45 -0400 From: Jason Gunthorpe To: Andrea Arcangeli Cc: Linus Torvalds , Andrew Morton , 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 , Nadav Amit , Jens Axboe Subject: Re: [PATCH 0/1] mm: restore full accuracy in COW page reuse Message-ID: <20210111155245.GM504133@ziepe.ca> References: <20210110004435.26382-1-aarcange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jan 09, 2021 at 09:51:14PM -0500, Andrea Arcangeli wrote: > Are we spending 32bit in mm_struct atomic_t just to call atomic_set(1) > on it? Why isn't it a MMF_HAS_PINNED that already can be set > atomically under mmap_read_lock too? There's bit left free there, we > didn't run out yet to justify wasting another 31 bits. I hope I'm > overlooking something. It needs to be atomic because it is set under gup fast, no mmap lock. Peter and myself did not find another place to put this that was already atomic > The existence of FOLL_LONGTERM is good and makes a difference at times > for writeback if it's on a MAP_SHARED, or it makes difference during > GUP to do a page_migrate before taking the pin, but for the whole rest > of the VM it's irrelevant if it's long or short term, so I'm also > concerned from what Jason mentioned about long term pins being treated > differently within the VM. Why? They are different. write protect doesn't stop modification of the data. How is that not a relavent and real difference? Jason