Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp893865imm; Fri, 28 Sep 2018 08:30:34 -0700 (PDT) X-Google-Smtp-Source: ACcGV602G7NcUF4H1kBg4oIpyZ5+yROZJixBgP0WxWghBlTwIW6WR/Cso8xkRtMfgP0A/Q6IR0fJ X-Received: by 2002:a17:902:d808:: with SMTP id a8-v6mr17214567plz.306.1538148634856; Fri, 28 Sep 2018 08:30:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538148634; cv=none; d=google.com; s=arc-20160816; b=s+rtVX7QEx3x3yE5+9D5NYswoh0YAEMTPHPWD7YSkabLUZMzXOoOewSAKLgP9VMj9P 0orX+/IQb9epQEgHjKrwkeoPnClDEjrt6jacCrryK3ffWNjQJSuWqd5wgrf+WND8CDbU mk9S66K5Uvn9Wzo4KXY5IBd97G9D644wPLyDkUlbDAs0Q9g3lHJ+YyqnzstH9LHoKn7+ Bx20QLjs5MfxDD0AG6HEJeFFz1SPOhcOa5aGMhjXBvtZ00q5TMjCwSXOc7vnsFZAKS4W RqPOpXVN42Nt7cn/bjq4MkExjCl/tAJ0sdL+TEaegOBCG+sjb0kF/UdDCP8tc0qM7XdD 3xrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=lC3qchJ11XdxvW8DOzLrkOug/xm62apuTLJ8aYWPeOs=; b=F7tygmGzwuPCK9A7lwnEuBq0QhYJQScctD6SJn5/eORA1T5H3RVZKLHRTBv82FBRvT HjUeKnRJhpibM21v0MfKlkdgVm7/EO/cJapoVlzzvvjTJfVO/hNzrjAnC1FAxbpHNC3P 31xUTWZJFc5WLQTuDEsmZWfYoGmuR6SquPg9/bQrLIY4/1UuZY91cHGg1U7wD0yM+qMy /fhqlLeNiEBhPtfWUnvpaMvjFcb0cLLH7bn9DEcTZzwvq4Crj9U5jDDbhGboY4amO0DR rwVFRFRxj3GOx0pLKLRsw/4H9qZAnVEJlEKvh4XofFf6mhhz1vPrlY+OgMPNPugZ5XcI lkKA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b11-v6si3922295plb.273.2018.09.28.08.30.17; Fri, 28 Sep 2018 08:30:34 -0700 (PDT) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729193AbeI1Vy1 (ORCPT + 99 others); Fri, 28 Sep 2018 17:54:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43814 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726473AbeI1Vy0 (ORCPT ); Fri, 28 Sep 2018 17:54:26 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5765F1B96; Fri, 28 Sep 2018 15:30:10 +0000 (UTC) Received: from redhat.com (ovpn-121-210.rdu2.redhat.com [10.10.121.210]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 663B85D791; Fri, 28 Sep 2018 15:30:03 +0000 (UTC) Date: Fri, 28 Sep 2018 11:29:59 -0400 From: Jerome Glisse To: john.hubbard@gmail.com Cc: Matthew Wilcox , Michal Hocko , Christopher Lameter , Jason Gunthorpe , Dan Williams , Jan Kara , Al Viro , linux-mm@kvack.org, LKML , linux-rdma , linux-fsdevel@vger.kernel.org, John Hubbard , Christian Benvenuti , Dennis Dalessandro , Doug Ledford , Mike Marciniszyn Subject: Re: [PATCH 0/4] get_user_pages*() and RDMA: first steps Message-ID: <20180928152958.GA3321@redhat.com> References: <20180928053949.5381-1-jhubbard@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180928053949.5381-1-jhubbard@nvidia.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 28 Sep 2018 15:30:10 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 27, 2018 at 10:39:45PM -0700, john.hubbard@gmail.com wrote: > From: John Hubbard > > Hi, > > This short series prepares for eventually fixing the problem described > in [1], and is following a plan listed in [2]. > > I'd like to get the first two patches into the -mm tree. > > Patch 1, although not technically critical to do now, is still nice to have, > because it's already been reviewed by Jan, and it's just one more thing on the > long TODO list here, that is ready to be checked off. > > Patch 2 is required in order to allow me (and others, if I'm lucky) to start > submitting changes to convert all of the callsites of get_user_pages*() and > put_page(). I think this will work a lot better than trying to maintain a > massive patchset and submitting all at once. > > Patch 3 converts infiniband drivers: put_page() --> put_user_page(). I picked > a fairly small and easy example. > > Patch 4 converts a small driver from put_page() --> release_user_pages(). This > could just as easily have been done as a change from put_page() to > put_user_page(). The reason I did it this way is that this provides a small and > simple caller of the new release_user_pages() routine. I wanted both of the > new routines, even though just placeholders, to have callers. > > Once these are all in, then the floodgates can open up to convert the large > number of get_user_pages*() callsites. > > [1] https://lwn.net/Articles/753027/ : "The Trouble with get_user_pages()" > > [2] https://lkml.kernel.org/r/20180709080554.21931-1-jhubbard@nvidia.com > Proposed steps for fixing get_user_pages() + DMA problems. > So the solution is to wait (possibly for days, months, years) that the RDMA or GPU which did GUP and do not have mmu notifier, release the page (or put_user_page()) ? This sounds bads. Like i said during LSF/MM there is no way to properly fix hardware that can not be preempted/invalidated ... most GPU are fine. Few RDMA are fine, most can not ... If it is just about fixing the set_page_dirty() bug then just looking at refcount versus mapcount should already tell you if you can remove the buffer head from the page or not. Which would fix the bug without complex changes (i still like the put_user_page just for symetry with GUP). Cheers, J?r?me