Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp191070imm; Mon, 1 Oct 2018 08:30:02 -0700 (PDT) X-Google-Smtp-Source: ACcGV60PFGy0Hy24nj5+PgxQb1VjWMoRUXYBSZOIuBb3lcGu95zWW7ELyAq5NJ7IB04lO63mqsqD X-Received: by 2002:a63:1224:: with SMTP id h36-v6mr10904505pgl.120.1538407802059; Mon, 01 Oct 2018 08:30:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538407802; cv=none; d=google.com; s=arc-20160816; b=JAwopxktmoSB7FlNDyD2im+QlAa2cjHj0ZBx24/ITE4qHdXVGIVSWVNgpbMyQ9SOAM QzF+EdmI3khdEvAlZARk3ihLRc/T1ggNCkTwabEwdvrurHZ0itcRqLQV+q1a/HbBTMR7 LUbfB90iow7x210GLlrucwXRmgxNJn8dX19Xh7DqDzQcLo6oCeDvf06vApL6hE1+Pgvo FvEfYOFtoooMwpYFSqioI+dTHD/BOvCA2tBH+bXotu2fz5MK6Pv9+3XgkbAc59q42EdQ HWbJZoMfeiUVmp92vdsW2lR53PyUW4ziU9dus8hqLKFXNlZTmS9EGRQ3tLE2MXEMB6oP Aheg== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=b9w8CzqceJIphm0F2qXV3pjYrrBaiq25/x/Fa59yiaM=; b=pzj09zUnfwqjqunrAXL8imyxp+soILk+hl0Xut6sEdx7iWKhg2rUYdziSMnwmQeRbt QX6cvusC4Hk9KaIuWnzKLz/AB6S6Nqh0+weN60hNEJ1Ej+40j7BDECghgIDu5O1+D4SG o7vJ05ClkZ4k9etINmy2Z2+1VIKRF9Wxd975HVseJRUNMsK3GwzHg6X2lpFbwhWgDsmU Tph+qB1LJ/obsS5wKuUcZJChjpLECjlUyp/Mnm0OSTXM6goEtv9uMcabBoX/JeV8BP/X 2fLCeRPLQhDB8dqqw2YdUjQMi5JArfafvvjck68zOveE40feEC/hEjoB4UK6XtTkMnrr 3Mwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=TGQPVha4; 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 s15-v6si12982341pgr.232.2018.10.01.08.29.47; Mon, 01 Oct 2018 08:30:02 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=TGQPVha4; 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 S1729567AbeJAWHy (ORCPT + 99 others); Mon, 1 Oct 2018 18:07:54 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:48116 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729516AbeJAWHy (ORCPT ); Mon, 1 Oct 2018 18:07:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=b9w8CzqceJIphm0F2qXV3pjYrrBaiq25/x/Fa59yiaM=; b=TGQPVha4/QjISKjoJbky346n9 BGvCr+VcnxcgdN8JMQO4iPCaMrHSz8HdRjDEf1WLuT6mFx+wtdZiUKbA+NMzOQc/Wx8S4PtPbgs73 TMXo5RU6GV7HAfxb0ciWZ/yqRsMYJ09YjsgX9tyj1dbXjuwSiB8sLNebbWBYnPHrI9qtEwJRjXHz4 ijp6Mpql7EyYw3T3z9MwnIUhI1sFf3GRkzG21dQ4eT9MsMfCY6cxshB8UFawsM/Y6tU4qJstVZ6I+ 30vYZfpDw6qqME9ww4LwXS1+xeMX2+CzNYRXWRo/9zW7idMSRJ37A1+neFJrkd628MSRlGEwxUO5d WD3pCs9Hw==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1g708Y-0007ZU-5N; Mon, 01 Oct 2018 15:29:30 +0000 Date: Mon, 1 Oct 2018 08:29:29 -0700 From: Matthew Wilcox To: Christoph Hellwig Cc: John Hubbard , Jason Gunthorpe , john.hubbard@gmail.com, Michal Hocko , Christopher Lameter , Dan Williams , Jan Kara , Al Viro , linux-mm@kvack.org, LKML , linux-rdma , linux-fsdevel@vger.kernel.org, Doug Ledford , Mike Marciniszyn , Dennis Dalessandro , Christian Benvenuti Subject: Re: [PATCH 3/4] infiniband/mm: convert to the new put_user_page() call Message-ID: <20181001152929.GA21881@bombadil.infradead.org> References: <20180928053949.5381-1-jhubbard@nvidia.com> <20180928053949.5381-3-jhubbard@nvidia.com> <20180928153922.GA17076@ziepe.ca> <36bc65a3-8c2a-87df-44fc-89a1891b86db@nvidia.com> <20180929162117.GA31216@bombadil.infradead.org> <20181001125013.GA6357@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181001125013.GA6357@infradead.org> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 01, 2018 at 05:50:13AM -0700, Christoph Hellwig wrote: > On Sat, Sep 29, 2018 at 09:21:17AM -0700, Matthew Wilcox wrote: > > > being slow to pick it up. It looks like there are several patterns, and > > > we have to support both set_page_dirty() and set_page_dirty_lock(). So > > > the best combination looks to be adding a few variations of > > > release_user_pages*(), but leaving put_user_page() alone, because it's > > > the "do it yourself" basic one. Scatter-gather will be stuck with that. > > > > I think our current interfaces are wrong. We should really have a > > get_user_sg() / put_user_sg() function that will set up / destroy an > > SG list appropriate for that range of user memory. This is almost > > orthogonal to the original intent here, so please don't see this as a > > "must do first" kind of argument that might derail the whole thing. > > The SG list really is the wrong interface, as it mixes up information > about the pages/phys addr range and a potential dma mapping. I think > the right interface is an array of bio_vecs. In fact I've recently > been looking into a get_user_pages variant that does fill bio_vecs, > as it fundamentally is the right thing for doing I/O on large pages, > and will really help with direct I/O performance in that case. I don't think the bio_vec is really a big improvement; it's just a (page, offset, length) tuple. Not to mention that due to the annoying divergence between block and networking [1] this is actually a less useful interface. I don't understand the dislike of the sg list. Other than for special cases which we should't be optimising for (ramfs, brd, loopback filesystems), when we get a page to do I/O, we're going to want a dma mapping for them. It makes sense to already allocate space to store the mapping at the outset. [1] Can we ever admit that the bio_vec and the skb_frag_t are actually the same thing?