Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1004643imu; Thu, 13 Dec 2018 07:57:24 -0800 (PST) X-Google-Smtp-Source: AFSGD/W36+u3fmo0l9DotKi1+Dhy96mBCBMpkBURoRxbmT4WYrkQvtkgMasZGsvKmsfsk+CAEfD+ X-Received: by 2002:a62:da5a:: with SMTP id w26mr24551600pfl.106.1544716644711; Thu, 13 Dec 2018 07:57:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544716644; cv=none; d=google.com; s=arc-20160816; b=zWRjB9b/VUK/dACjX2sDpQ09lSTZD8PKBEtrkxCVSmJpKGuL+Yd28S7Llab3OsDsN7 SszqCpRgPsbU2yrUFYjxf9uSHFKGqL7xkerSv+xHHnA/mMITGZv03eCbBHB/R7Sr5PG9 i9adx2Hw/FqLBb3cb0AADecPw0+Es2nF3ngcCdxKIYnznQusfqKoVlMIqBqEXZXh1aCI wgL5v/HOIqOgPF41qd79mXjhmYeTOSaeEORMFJeU+z3/ITV4xf9z/PBxhmOd3etiDNfi N+DcQ+/G6okUDbgiUJO6m+cMdlhFDFHF7aBYFOCn5CC07YHK/easxJEVcgXz7dY6OfFT 6poQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:feedback-id:mime-version:user-agent :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=EuD/UKVeMaD8t4ZdlyEuRp0RdjSeYn89TStCGl31mP0=; b=gJfdIApq3+bOAAniSwIJlRtbeG3s8+y5GOAM5w4rTLJt6s4v+r5lXVBbzmwHnGst3E LQ9g91OMCoEwqJpxzRUlUUwtOBh+rjE2SdAWA25DNUj+q0eJh+OgOa3OX/tX/KgxhVdM HrlNwPFmQtFwMJGEzv4eBrz0t9PMGQqCF8njypX8vTHNR2g++k8QBDzjZciTjntTlPc1 M+eEaEBQmt3OYRs7hSI64NSBmtPNA2oAbvGGj0kVmIw9EjsNV++Ss6DU3ZgnUBMYg5EO uxhnQMEls1H4HIRDCMK3loEUjGH4PlXuEQu1eqI8IwBj1TY6ron1vJAMLHA7hKdQxRTb Pifw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazonses.com header.s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug header.b="QHf/o7fZ"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k135si90501pgc.574.2018.12.13.07.57.01; Thu, 13 Dec 2018 07:57:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amazonses.com header.s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug header.b="QHf/o7fZ"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728842AbeLMP4G (ORCPT + 99 others); Thu, 13 Dec 2018 10:56:06 -0500 Received: from a9-114.smtp-out.amazonses.com ([54.240.9.114]:43172 "EHLO a9-114.smtp-out.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727707AbeLMP4G (ORCPT ); Thu, 13 Dec 2018 10:56:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1544716565; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:MIME-Version:Content-Type:Feedback-ID; bh=NZabmP3XK9/5WAKKWC7R595/zGK/oTVP2WOhqXoEXqg=; b=QHf/o7fZT9OJhhJg0RiOZNIi1yEGSh+sOyZp8rZgM1JekqaNoGoZSvpLHkw3OvJj lQZwiM31jeFJTqYMBRSmMMff0XR/AlcyAibWiNbD68JjdPgOKCvcP6cuvQuqsrBo+Pe HyW2PcOPBsR2AXeE4WjYHRMC1+/efbtvRSoSUXDg= Date: Thu, 13 Dec 2018 15:56:05 +0000 From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Jerome Glisse cc: Dave Chinner , Jan Kara , John Hubbard , Matthew Wilcox , Dan Williams , John Hubbard , Andrew Morton , Linux MM , tom@talpey.com, Al Viro , benve@cisco.com, Christoph Hellwig , "Dalessandro, Dennis" , Doug Ledford , Jason Gunthorpe , Michal Hocko , mike.marciniszyn@intel.com, rcampbell@nvidia.com, Linux Kernel Mailing List , linux-fsdevel Subject: Re: [PATCH 1/2] mm: introduce put_user_page*(), placeholder versions In-Reply-To: <20181213020229.GN5037@redhat.com> Message-ID: <01000167a8483bd2-16ae0d3e-d217-4993-a80a-25d221c677e4-000000@email.amazonses.com> References: <59ca5c4b-fd5b-1fc6-f891-c7986d91908e@nvidia.com> <7b4733be-13d3-c790-ff1b-ac51b505e9a6@nvidia.com> <20181207191620.GD3293@redhat.com> <3c4d46c0-aced-f96f-1bf3-725d02f11b60@nvidia.com> <20181208022445.GA7024@redhat.com> <20181210102846.GC29289@quack2.suse.cz> <20181212150319.GA3432@redhat.com> <20181212214641.GB29416@dastard> <20181212215931.GG5037@redhat.com> <20181213005119.GD29416@dastard> <20181213020229.GN5037@redhat.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SES-Outgoing: 2018.12.13-54.240.9.114 Feedback-ID: 1.us-east-1.fQZZZ0Xtj2+TD7V5apTT/NrT6QKuPgzCT/IC7XYgDKI=:AmazonSES Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 12 Dec 2018, Jerome Glisse wrote: > On Thu, Dec 13, 2018 at 11:51:19AM +1100, Dave Chinner wrote: > > > > > [O1] Avoid write back from a page still being written by either a > > > > > device or some direct I/O or any other existing user of GUP. > > > > IOWs, you need to mark pages being written to by a GUP as > > PageWriteback, so all attempts to write the page will block on > > wait_on_page_writeback() before trying to write the dirty page. > > No you don't and you can't for the simple reasons is that the GUP > of some device driver can last days, weeks, months, years ... so > it is not something you want to do. Here is what happens today: I think it would be better to use the established way to block access that Dave suggests. Maybe deal with the issue of threads being blocked for a long time instead? Introduce a way to abort these attempts in a controlled fashion that also allows easy debugging of these conflicts?