Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3438imm; Mon, 1 Oct 2018 05:51:51 -0700 (PDT) X-Google-Smtp-Source: ACcGV63vtgyFnK2cZOa2/ly67pHYVdqnclId/m0bSmfr/VVkkMfbi1p9w9Gh7t7kjvCNfUOzOpDZ X-Received: by 2002:a63:f501:: with SMTP id w1-v6mr10130455pgh.336.1538398311641; Mon, 01 Oct 2018 05:51:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538398311; cv=none; d=google.com; s=arc-20160816; b=FdjR6l7AiMcSEzODVewV2DFBd702A+iyS9cUPuDTHZg8JGH/EJyEVXfrPjvK+IZbA9 +esg0+VPclpOxQ02BQYQmZlAK1WE2E3mRHEqOd/Np1TfRwTKfdvGKL6BfWNgtWyQdSqf HpyIzbEEnuNdkbDvOBPMBSikvTSQAuvXfWAaedvfyyU1IAVK52AUKqOWdfIPar72J0PZ 41OZ5cRa2K8YvrJgeVSrhqHueG4QF0w4qCYWMiYirs7GLCY7tG4dVy1ciHpHRoW4Rbqh 4i3e3YFdcjPwns66q+EHcg/EFYLxVDsV5nNJURo75pILNVuGWu9te7yhK61qATSkAb3I 0HBQ== 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=NonZwhYN1xJ/vVVD3nbyJq69mXPUQ3mi0852cfgwYIA=; b=NRq9xqIUF+fpL3g55xBm/7PQd970c9Hv0n9bPwj1km1d/ElaNQFMazo2A3OyPULYT6 PvlOHPBW0opu04xoHsGjvkYtH00GgJIDq1IwOAMP2/M7CUnAuU+9uGDabuiOB/hAjnni lE+KCN4eSzYsMpVAR5dK0rraMdQ2K8m0XlaFH2s3tJpgPY1HROQHM9PmRDdpeNj6bXKM Qcrqz09Zv6vlZuPmFgqzgBF23mM5eA8OT1pyqhJSBQR9e6p7KSiJa+Kq7pegybm1xxKf lBILBnRPvN/PkatTI4iyZD0WeNPVZ2MF4QXftZMKw3FgLGf0RXF6k3+MIkNZHe897hZT Xl1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=VSKlpbDh; 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 i21-v6si12266748pfo.333.2018.10.01.05.51.36; Mon, 01 Oct 2018 05:51:51 -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=VSKlpbDh; 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 S1729286AbeJAT16 (ORCPT + 99 others); Mon, 1 Oct 2018 15:27:58 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:49406 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729149AbeJAT16 (ORCPT ); Mon, 1 Oct 2018 15:27:58 -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=NonZwhYN1xJ/vVVD3nbyJq69mXPUQ3mi0852cfgwYIA=; b=VSKlpbDhFhqm38A6Uv1txT8Ih Tc7wr5SGUgkak9snJm4Y9Rr1Bb3fWwQCSLWsI5hEF4p3+Sv90RIWCFzuI9y+aRgqzpZdPsmbQ8KgR bhUnlwNPoYFYmT8GtAJu/egkUBXc8JQNvN6jgFMu5sjvZNWyAe9VV6keAZzAk9owGBqqTqJ6hOU3W kWVg9SG6gzt3EyJSbsWod3G3AjXhb5yG6EXM14phBvIhMzfJxmR/Kk3UChoMb9t0OD5JTbhubB5c5 UJVwJd4AeKe/HUVRMQURMA6yURrJGOHBYq/2WSGutqbXyVhYGNusv9qIwZZCCfajwjLdC9023tstF Mhh3xq1IQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1g6xeP-0002ww-Oi; Mon, 01 Oct 2018 12:50:13 +0000 Date: Mon, 1 Oct 2018 05:50:13 -0700 From: Christoph Hellwig To: Matthew Wilcox 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: <20181001125013.GA6357@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180929162117.GA31216@bombadil.infradead.org> User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.