Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3570830pxk; Mon, 21 Sep 2020 18:16:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzeU1qBo3dCmNzp8q/kERpnhOOn9TmTbwHYNMsCsfrEyqqtTPhaU067qFQGXRczIqBpyH3e X-Received: by 2002:a17:906:71c9:: with SMTP id i9mr2296170ejk.250.1600737395053; Mon, 21 Sep 2020 18:16:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600737395; cv=none; d=google.com; s=arc-20160816; b=g7MxEEfrzP25eRp7hIfBR41Z/bUVgQlQ6HYwRTApuMOVykpukTiqRobNSJ7EUgiKPO eog11ZP8QQyGTublJAhN0ijB8eIvf020wIQ5GdEfXOkIfpVHnNpvqOPPmYb9jsx+mIh/ xuvTxoScEukl6subNVxHmRCYJYnBgF0KLBUtcys7eFMW2j09EH91n0KoXVCM0kw3rbS1 QHKhjCSJli5GuZgZZeK7DjkiDwhftMf1MXJjcpQ6zOwO0R6a4KsVIBkc7TbCvNJYzZQ7 rCd2vOUpcLjSApvrFX9eS0xVf2RdVDQ1IYJiOLFI9cb1X1g8ViNhqNC8HsA/SRFb7OzM VMEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=pICGIgAAbiHAuske7W1id4qK5tmRw17lO8+nrtcOwW4=; b=gVS/aDVY7524hL50XGIsUTVfuzB3wXWB9Ii3mNjyzL67nwM4hCQsL0w13V2Y/AeJvw rIMok1G8WlNgwIv7C1tavSu8zC+CUL9kuE1B1aPexuDwcPwWbiSKu3bEVUr5AsZKr9vQ Aim8ngOOJd7j8HKsA7mqm1fN0NFJBGLQQsWfR2Yc0CMe5Z4/LxGDVs9d0OvBxfvvo+cm 1rMWmfenlKNLaCc/bE8bZH7DaWReVMR31RZhr0wxHTO3wUXXGVp9smb4OYX1uo/JzyxI dtEZQZBmlwvTBdgHxX3NaOXqBF1YXlkCpTXWs8Id0Di6mikoFJb1UDkPYM3CppF9cR0T QAJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=SYPWmsd+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qc14si11055263ejb.379.2020.09.21.18.15.59; Mon, 21 Sep 2020 18:16:35 -0700 (PDT) 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=@nvidia.com header.s=n1 header.b=SYPWmsd+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728811AbgIVAIl (ORCPT + 99 others); Mon, 21 Sep 2020 20:08:41 -0400 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:2862 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728517AbgIVAIk (ORCPT ); Mon, 21 Sep 2020 20:08:40 -0400 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Mon, 21 Sep 2020 17:08:27 -0700 Received: from [10.2.52.174] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 22 Sep 2020 00:08:39 +0000 Subject: Re: [PATCH 4/5] mm: Do early cow for pinned pages during fork() for ptes To: Jann Horn CC: Peter Xu , Linux-MM , kernel list , Linus Torvalds , Michal Hocko , "Kirill Shutemov" , Oleg Nesterov , "Kirill Tkhai" , Hugh Dickins , "Leon Romanovsky" , Jan Kara , Christoph Hellwig , Andrew Morton , Jason Gunthorpe , Andrea Arcangeli References: <20200921211744.24758-1-peterx@redhat.com> <20200921212028.25184-1-peterx@redhat.com> <07bc5f59-74ae-73e8-2616-f11712c27b58@nvidia.com> From: John Hubbard Message-ID: <24037577-0b96-4d8c-9487-8e788fbc29eb@nvidia.com> Date: Mon, 21 Sep 2020 17:08:39 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1600733307; bh=pICGIgAAbiHAuske7W1id4qK5tmRw17lO8+nrtcOwW4=; h=Subject:To:CC:References:From:Message-ID:Date:User-Agent: MIME-Version:In-Reply-To:Content-Type:Content-Language: Content-Transfer-Encoding:X-Originating-IP:X-ClientProxiedBy; b=SYPWmsd+dUkTOoJG4eRvvYWKKvK78cSn5KzELaZzoRknrDMUJmzPBs3udYNmixYtO gtwRnx454MPX3QSm/RpBoEa+02m5cCdMMh4ORJqCW3fBXuZsWduJ3rzxHDrK67mp3r 4NFix4SbBUX8JshseEBi9Kz4CQYgpOOSNuZBVNBEYFTT9MmRV8za/w4ZyORDH0iODD j/oFnSj071MnxkodIXgXLL2kL7kAZgvqNdqnlAbUYiOssatNfGHczbK0DtjszrQXp1 090E3B5dRl4ir5GLltzEsi4UuXg8X5uIasw9I8EB0zJ1Ek1izP9rVYZ1zzSquXnYEy gmRo3eTHLZmOA== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/21/20 3:27 PM, Jann Horn wrote: > On Tue, Sep 22, 2020 at 12:18 AM John Hubbard wrote: >> On 9/21/20 2:55 PM, Jann Horn wrote: >>> On Mon, Sep 21, 2020 at 11:20 PM Peter Xu wrote: >> ... > Ah... the documentation you linked implies that FOLL_WRITE should more > or less imply FOLL_PIN? I didn't realize that. > hmmm, that does seem like a pretty close approximation. It's certainly true that if we were only doing reads, and also never marking pages dirty, that the file system writeback code would be OK. For completeness we should add: even just reading a page is still a problem, if one also marks the page as dirty (which is inconsistent and wrong, but still). That's because the file system code can then break, during writeback in particular. thanks, -- John Hubbard NVIDIA