Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp3257289ybh; Mon, 5 Aug 2019 15:06:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqxjCX9I5s+B7m8SyF/ZVgNsau9MRoe8LZwkCzLsOXR2xuTrCgr4UAzilaHMU9OMV7X5zcaG X-Received: by 2002:a65:5348:: with SMTP id w8mr90726pgr.176.1565042764176; Mon, 05 Aug 2019 15:06:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565042764; cv=none; d=google.com; s=arc-20160816; b=R/3Yx1pmLaxbQ6X6WYmmY97ahh7Y0nh3CLacJkCW2vw7LDUI4Lx0y+tiJIILVf744q EeIcnWOCH5gFLZvBOTAVBEDAmyuTMFaJzDPFNfngzkC914blVKMwbAN/WwwkpCGHkDCI fOLAHQ0g3O36a6WXf3kzUor3ZtHgqcyKQBM8WN8pB5LJnBaOEycNPV/dABfkPNOBgyVA twANIWXzJ1C0dW0f3l5Z9nSgqZUxojJnpTPGPmx+4/7QsoFALkMHmUgtojC+5RcKdcN3 KbhyGeTLKCILnpYuKNihS4ILIQkLDQTKSq+4dRrEn/sRWoPbAN6PLyLb9LVzEtttkFIk N2gA== 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=Z1vqL6JMXTNrRYHObPRcXJ36gZwsKRpaiXu6xbYwXcI=; b=a9EHOq5Zr8ILvfGL5S55spGZ7nGddp2YU7+OoG43qjgNWj9Nv84IFwB3WbioHZz8Fe DNtc2bSzrfpQ5mmvcsZdKtLqx8Yc4pmCmBLnGaD3ESuTRyrqED9G9nbVCbRCnsK4oim7 yn7DW9NJpqmCNBLg9WVfIu4lDZsMH2HwfkfIdkUXw77aWZElSHOffv2LblDToFCwpefv jUJFkICdsHJ7KZkUCZNwh+PCWHnDXe4/J2rHeH8AwYTBgu4KqGQWsdonfu9Io5X0cxX0 R+WiOlLmLEpml3D+ex7EoP17Fg9R/Pn0CtcHchPxP7S+CZCKZQB9idmG5btr3A8/hm2S v/og== 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 z24si43589636plo.159.2019.08.05.15.05.47; Mon, 05 Aug 2019 15:06:04 -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 S1730849AbfHEWEo (ORCPT + 99 others); Mon, 5 Aug 2019 18:04:44 -0400 Received: from mga09.intel.com ([134.134.136.24]:5380 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727928AbfHEWEn (ORCPT ); Mon, 5 Aug 2019 18:04:43 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Aug 2019 15:04:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,350,1559545200"; d="scan'208";a="373219765" Received: from iweiny-desk2.sc.intel.com ([10.3.52.157]) by fmsmga005.fm.intel.com with ESMTP; 05 Aug 2019 15:04:42 -0700 Date: Mon, 5 Aug 2019 15:04:42 -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: <20190805220441.GA23416@iweiny-DESK2.sc.intel.com> References: <20190805023206.8831-1-jhubbard@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190805023206.8831-1-jhubbard@nvidia.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 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 > --- > 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 >