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.7 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,URIBL_RED 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 67C04C433DB for ; Sun, 10 Jan 2021 01:37:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EC76B22516 for ; Sun, 10 Jan 2021 01:37:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EC76B22516 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 133556B00EF; Sat, 9 Jan 2021 20:37:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0E3CD6B0114; Sat, 9 Jan 2021 20:37:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F13F98D0002; Sat, 9 Jan 2021 20:37:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0218.hostedemail.com [216.40.44.218]) by kanga.kvack.org (Postfix) with ESMTP id D83206B00EF for ; Sat, 9 Jan 2021 20:37:28 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 9273A362B for ; Sun, 10 Jan 2021 01:37:28 +0000 (UTC) X-FDA: 77688152976.18.room69_1d0324127500 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id 7AEB3100EC678 for ; Sun, 10 Jan 2021 01:37:28 +0000 (UTC) X-HE-Tag: room69_1d0324127500 X-Filterd-Recvd-Size: 4857 Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) by imf48.hostedemail.com (Postfix) with ESMTP for ; Sun, 10 Jan 2021 01:37:27 +0000 (UTC) Received: by mail-lf1-f51.google.com with SMTP id o17so32430540lfg.4 for ; Sat, 09 Jan 2021 17:37:27 -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=uBVkrWF/ITar/TCRB0GlVs8VwamJlUjk1ZeB4Qt+7CQ=; b=OVfU5l5FRJKWzy0gPczQthTegFzC6xnQ2MOTRxvojatPuTnPfi539OuCVllS+6LMII mhrWP++mZblQDRv00D8nSfg8WdwVc6kke9jo8QJ7hr0ToXIYuk2O0WtvxiMwSeaFiZNw UU1h1bCjbfkAEabzFJuhnFGnSW/Hk4Fjjs9K8= 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=uBVkrWF/ITar/TCRB0GlVs8VwamJlUjk1ZeB4Qt+7CQ=; b=KBERIFB9Bjg1cU2AgiOYm2S7p8/4ra8L6//F6iH5jBIkWsY1ppQ00DpZG0EMMgPThw G5uUDIXIOaBGtfVGi+Js5dYZc1eCg0x+jo8cNL9XllJ612CNth/9tMQ+cUfyIurSJEm7 q7oGALLtx+fng+wFjZKoJzwZNMLM/URObtDUhL5oAnTNmy+wLBC0XtiIDcad8t+Oafs+ p4Zi5HrYHAehx9tGbx8zgDX+8fJnwhDOmloztdg7JVOGiFq+btNG4ko/qsw+/ZaWANG5 ntw3YzY8PSIj0h85Wbslbzn5YdKR0ppGsk8QY6ATYBAg6bbcBBnPCLziFD7bWecGs23/ zsmg== X-Gm-Message-State: AOAM531Umt5LhgWgDXP0mFltq8BVbwROY7gB8+jrMUZUN12E7Pj9OX8a 2FmDaBv3RL2wkJwF0YnJt5F8SnfDK99JUQ== X-Google-Smtp-Source: ABdhPJxvaMqSjuNV2x/80AcSTK6wzx+c7P1SfNK9N32kRS589xXDgP4QfhnzUV6eeBE011gpkJzHLQ== X-Received: by 2002:a2e:9dc3:: with SMTP id x3mr4800254ljj.326.1610242646644; Sat, 09 Jan 2021 17:37:26 -0800 (PST) Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com. [209.85.167.45]) by smtp.gmail.com with ESMTPSA id j15sm2565300lfh.230.2021.01.09.17.37.25 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 09 Jan 2021 17:37:26 -0800 (PST) Received: by mail-lf1-f45.google.com with SMTP id m12so32390426lfo.7 for ; Sat, 09 Jan 2021 17:37:25 -0800 (PST) X-Received: by 2002:a19:f014:: with SMTP id p20mr4272695lfc.421.1610242645588; Sat, 09 Jan 2021 17:37:25 -0800 (PST) MIME-Version: 1.0 References: <20210110004435.26382-1-aarcange@redhat.com> In-Reply-To: From: Linus Torvalds Date: Sat, 9 Jan 2021 17:37:09 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/1] mm: restore full accuracy in COW page reuse To: Andrea Arcangeli Cc: 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 , Jason Gunthorpe , Jan Kara , Kirill Tkhai , Nadav Amit , Jens Axboe 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 Sat, Jan 9, 2021 at 5:19 PM Linus Torvalds wrote: > > And no, I didn't make the UFFDIO_WRITEPROTECT code take the mmap_sem > for writing. For whoever wants to look at that, it's > mwriteprotect_range() in mm/userfaultfd.c and the fix is literally to > turn the read-lock (and unlock) into a write-lock (and unlock). Oh, and if it wasn't obvious, we'll have to debate what to do with trying to mprotect() a pinned page. Do we just ignore the pinned page (the way my clear_refs patch did)? Or do we turn it into -EBUSY? Or what? So it's not *just* the locking that needs to be fixed. But just take a look at that suggested clear_refs patch of mine - it sure isn't complicated. Linus