Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp3259146ybh; Mon, 5 Aug 2019 15:08:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxauRuDCsXrOZo7IhQ0JL4Ocbn0oPN2SoYtf21MR2u0jqWePrvATSBAZYkVkjSQtpNB0Xjw X-Received: by 2002:a17:90a:fa18:: with SMTP id cm24mr19767324pjb.120.1565042883250; Mon, 05 Aug 2019 15:08:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565042883; cv=none; d=google.com; s=arc-20160816; b=KSrF40daTKSAPMSDSvw26i+E9PLmOH84VhMrXT8UucVkGwN9mIjqd7cqJHeJh5KF9F PgzWZkYPFqREf/8vLGVPNnlgBVWKhj/SDoD6HRsrFNV3rMyIPOt4w3VgAHYij2iFikKi lMG1T66pKkCl6QUp/XNcIk/NoDv9V/MPKdXPPic2KYtdYcz5CoRqwKo5qHURMh/L6EKL w/Uck7DC7rQzalXVqg6/gCXWv1fnJET3HNeLUiCSFeLcEzdXSeTO8ySWFLlh0x6g+OQ5 jIGJFB/G7KujWR6Vy7czTz3xFVvs0rhmvn0bhSoQz/0iKvWsXUj160NQ/7FC7Om15mwQ AH0g== 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; bh=pDaTeb9IaOKhAKJKqRRPSklvjeNnK+0piCiT4cVDf6M=; b=iyTaydlHQ//B4CI5uq2y3rPNSJUdaaCrqKWmtuppeMP4vbxEjDQFIWqhmD/mwrOes4 Np5K7WfjH+ADD1/12ogxhegFSuPw5mOX1GefYzH84y84no9XxDyu4oGgBxJZv+DdDMxI so2HTc/QgcX9DDs+7zJ9UugBpsUHkp9uLS9fqJKcj1P33rjPjjDCw1zP2NNkvOeXIzyn JQ/bC9g1hSe2zqGpzmFzukLCdsxs8AfhTVzta5Y7865KdTGCBj5pmilA8wmelVYHPVhE nk+Ltdf5PQl99NRhnQkCOezXUd93tJTv5YGZMoM/RaYQZZyNrX1bJU7HiLgM0MSmIyTQ afQw== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l15si13771533pjq.104.2019.08.05.15.07.47; Mon, 05 Aug 2019 15:08:03 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730875AbfHEWFu (ORCPT + 99 others); Mon, 5 Aug 2019 18:05:50 -0400 Received: from mga04.intel.com ([192.55.52.120]:9872 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726847AbfHEWFt (ORCPT ); Mon, 5 Aug 2019 18:05:49 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Aug 2019 15:05:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,350,1559545200"; d="scan'208";a="349235770" Received: from iweiny-desk2.sc.intel.com ([10.3.52.157]) by orsmga005.jf.intel.com with ESMTP; 05 Aug 2019 15:05:48 -0700 Date: Mon, 5 Aug 2019 15:05:48 -0700 From: Ira Weiny To: john.hubbard@gmail.com Cc: Andrew Morton , Christoph Hellwig , Jan Kara , Jason Gunthorpe , Jerome Glisse , LKML , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, John Hubbard , Alexander Viro , Jens Axboe , linux-block@vger.kernel.org Subject: Re: [PATCH] fs/io_uring.c: convert put_page() to put_user_page*() Message-ID: <20190805220547.GB23416@iweiny-DESK2.sc.intel.com> References: <20190805023206.8831-1-jhubbard@nvidia.com> <20190805220441.GA23416@iweiny-DESK2.sc.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190805220441.GA23416@iweiny-DESK2.sc.intel.com> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 05, 2019 at 03:04:42PM -0700, 'Ira Weiny' wrote: > On Sun, Aug 04, 2019 at 07:32:06PM -0700, john.hubbard@gmail.com wrote: > > From: John Hubbard > > > > For pages that were retained via get_user_pages*(), release those pages > > via the new put_user_page*() routines, instead of via put_page() or > > release_pages(). > > > > This is part a tree-wide conversion, as described in commit fc1d8e7cca2d > > ("mm: introduce put_user_page*(), placeholder versions"). > > > > Cc: Alexander Viro > > Cc: Jens Axboe > > Cc: linux-fsdevel@vger.kernel.org > > Cc: linux-block@vger.kernel.org > > Signed-off-by: John Hubbard > > Signed-off-by: Ira Weiny I meant to say I wrote the same patch ... For this one... Reviewed-by: Ira Weiny > > > --- > > fs/io_uring.c | 8 +++----- > > 1 file changed, 3 insertions(+), 5 deletions(-) > > > > diff --git a/fs/io_uring.c b/fs/io_uring.c > > index d542f1cf4428..8a1de5ab9c6d 100644 > > --- a/fs/io_uring.c > > +++ b/fs/io_uring.c > > @@ -2815,7 +2815,7 @@ static int io_sqe_buffer_unregister(struct io_ring_ctx *ctx) > > struct io_mapped_ubuf *imu = &ctx->user_bufs[i]; > > > > for (j = 0; j < imu->nr_bvecs; j++) > > - put_page(imu->bvec[j].bv_page); > > + put_user_page(imu->bvec[j].bv_page); > > > > if (ctx->account_mem) > > io_unaccount_mem(ctx->user, imu->nr_bvecs); > > @@ -2959,10 +2959,8 @@ static int io_sqe_buffer_register(struct io_ring_ctx *ctx, void __user *arg, > > * if we did partial map, or found file backed vmas, > > * release any pages we did get > > */ > > - if (pret > 0) { > > - for (j = 0; j < pret; j++) > > - put_page(pages[j]); > > - } > > + if (pret > 0) > > + put_user_pages(pages, pret); > > if (ctx->account_mem) > > io_unaccount_mem(ctx->user, nr_pages); > > kvfree(imu->bvec); > > -- > > 2.22.0 > >