Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp1367539pxb; Sat, 9 Jan 2021 17:47:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJz9nFPzlcA7Hcm40iyDQ7Bv7AC6g99faexR8MVNeEGDC6FCvhtd30aD/fimOWsE6NEO4XhP X-Received: by 2002:a05:6402:11d3:: with SMTP id j19mr9702449edw.314.1610243228077; Sat, 09 Jan 2021 17:47:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610243228; cv=none; d=google.com; s=arc-20160816; b=vLy7HKn3jxHK0DjtxpqB0Qx1Rv5WvFK44dsXsfg6X7+3jxmpFKSHomDkKWpjfoMZ2a TTBXE0J1gqB/d2OMU26Si5MBV7nteQKkg1YLmKnU/KZr0AFlzD8+PLVDeFbDdr9tyY2b KV2Dzr35hKsP1wI8gfPYDuVarQg76dU4lvwpZiK7+NXvW9haKlGK/DCKywmbM9NLVmEu cIcYQTEeNIkWh+0WFT1ObfIv3tjG1IS2XRXyn5pMZWkvUS3cq3hLMlVz7zZQxKSzlST9 J7ae/Pi16b2P8LytDYOsJeTC7+EddjfOInhZFVoZ7LO5EHDBeupnfZQas6nmwLjnxcPq u++w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=uBVkrWF/ITar/TCRB0GlVs8VwamJlUjk1ZeB4Qt+7CQ=; b=iEQOhyTm/SgIXXtG6ZM7xcrtmqv2Xdux//oEPfHY+ls3iDaYcK8Yb6q8IKItQDZAae GS4sx+/KKpW6OTB3ndhFUcYJKZjKrcn4AEzha9UPpV0VviUNAyFS4zRLzYeySKYjv03L CM3o2T7OB8FitJxCAwn1JQid2e5hWmrlkGloOOemClGw4Y6j7/3h9isgsA1K4+CWmp+q yrD5mTHR84LC4wYjLovXsQ4sA6YJn5V8tUqqlsLuyY+6pE8OaHVIGsXEmV4KKhfhU5+G 9VMj70Fq7DSHbZq22dkBM2ZEJRTI9Y94CnszLgBN3bdTg2K7sOY2d5OUQPX5V2oZvccQ tiBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=OVfU5l5F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v21si5337499ejg.492.2021.01.09.17.46.34; Sat, 09 Jan 2021 17:47:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=OVfU5l5F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726370AbhAJBow (ORCPT + 99 others); Sat, 9 Jan 2021 20:44:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726090AbhAJBov (ORCPT ); Sat, 9 Jan 2021 20:44:51 -0500 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77907C06179F for ; Sat, 9 Jan 2021 17:44:05 -0800 (PST) Received: by mail-ej1-x62d.google.com with SMTP id ce23so19716108ejb.8 for ; Sat, 09 Jan 2021 17:44:05 -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=joP/+aKUtswpfa4O9hpk0y0g2DKUYCHwjPGjUjPWGX4QgwdTxmqNlu779qOmoz5CUC ftA4kbM0bZ9+tVebpavaHb5MTpImhiZp0l0bIwMub8JsbfpY7rc8AsrlZTU4epsspZQx yyeLu2k9P9+K+0sLtTId+ZCCYulu10X6TOClcs1wm9+59Fqub+UsfilEHYDBG9LN2ws6 KHgbgsjHS1smK7m/cJNFdKevOIeQUJNbZrZ7/C0RRSYAhE59jrkCQIdqn3UzmLntgDC0 496a3DHWfFlf04T89ZkWm01YKcan4alD4ryhHkUUfDUiiZGF/q12aqMms9+wZKUdAnEa 4U+A== X-Gm-Message-State: AOAM531rrxZvzalveafqfSsQ4ybicFzzM5t5+n8d1HGk+BHM32VzTVUi OfggEYerT3X8OGv8QWXkI+FFIPOttaqK2A== X-Received: by 2002:a17:906:5e0d:: with SMTP id n13mr6664630eju.500.1610243043972; Sat, 09 Jan 2021 17:44:03 -0800 (PST) Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com. [209.85.218.48]) by smtp.gmail.com with ESMTPSA id dk16sm5173420ejb.85.2021.01.09.17.44.03 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 09 Jan 2021 17:44:03 -0800 (PST) Received: by mail-ej1-f48.google.com with SMTP id g20so19812006ejb.1 for ; Sat, 09 Jan 2021 17:44:03 -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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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