Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11094988ybi; Thu, 25 Jul 2019 09:54:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqz6ZowfjFy2ekE6G603UFoIoue3RLB9l6NSrs+fIjLENvaSVZhnb7AWyxC307+un29BdIqT X-Received: by 2002:a63:ee08:: with SMTP id e8mr33192569pgi.70.1564073667604; Thu, 25 Jul 2019 09:54:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564073667; cv=none; d=google.com; s=arc-20160816; b=Af0MQTfYFX9caXBTQgZQghGo9B1lvkXS3Szgv27peHumyfz72PtcqifrGHNTGt4hrD 1+/K7sDjpqBCC8pbFlYibf9l5+WDvqoVz2W67wnaZTvXdK5ihYzyBq3ijoVqac4QL00b Y379i0o+xtOR90Pn5qYdJg1Yse1HRUFsrO2vzSoU8mZJrPdNEKlBGP6AxYSpVGSZcbM4 HpzEC2NntuuA9+Ch8A/bHcN2+OIyhP05nn7c0ptIhXWnL4JJZiD05Bq/W+z2V0u5A/LG pdCm2fk6TXHGC3rTafbWUwfUtqL8rejFkLL6EWWo7Es5bPGff0qZo8Jp4Pzp82ZvvhYH JysQ== 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:dkim-signature; bh=1FbnKtI3LwQwgUsr/g3MUa9Py+KRgg38b6IrILFDUhU=; b=TxRPwLKGJlbMcNIJaAJ3FomI0TJmk13LwTZWtUu0lhltBcUu3/Pkpd9G5HayINPomL 72MDGwLCprmF0VJrxUhJxkfjyxaeS5AhRDvoWZ7lxRCxr5tCxmk42OLkNVpi/DvolHrb zH2RGSFf0M58mF6WItLjGiQhpyckJVFlds0/1rYrBAEsXI3FfQLs3buUSG1b28US0rrk aifZgv6GBwzP6M1sVKnUDjGMt/zqxnr3bDuEoKc0aWMEh+UUkCfxI0sMgfWXwHhsjiuL ZF5gwjABnq8tzXWY6+5YbG8vK9tUvGqI3+pY72hzhkM0wAY1POOlVfscYteAopAflhLf FHPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RiPttf3V; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c62si20738342pga.441.2019.07.25.09.54.13; Thu, 25 Jul 2019 09:54:27 -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=pass header.i=@gmail.com header.s=20161025 header.b=RiPttf3V; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404008AbfGYLSo (ORCPT + 99 others); Thu, 25 Jul 2019 07:18:44 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:35019 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390493AbfGYLSo (ORCPT ); Thu, 25 Jul 2019 07:18:44 -0400 Received: by mail-pg1-f196.google.com with SMTP id s1so16578989pgr.2 for ; Thu, 25 Jul 2019 04:18:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=1FbnKtI3LwQwgUsr/g3MUa9Py+KRgg38b6IrILFDUhU=; b=RiPttf3VULytvTV1gQCGGIofaH3cmMvvcLlShfvYsVeKFzWjG/kfl/UguNaNy7/Dfo FVmH2PIQAE2iC69ldXu5sNi9yS2z2PuKCOKbuswCunkNuJwrNoEzBk2cOmbgVNaQZsql vWiZsd67ciYl95JIzgVUAExNBHZtC8mivPnxWK78M7nMNjVgpYOHWMOxtXNNo0v9cqC2 r/T/+iTbpnJX5k7uurmQUrJ54neQWBfYxzH6kvGeSJ+H2ILyhbfMSTjrInxG6dRzsZPQ t9CzL6qva/lkcI8XGhVlO+HAbtcciB4SanHFtxVMYgiTsIzVps4/IUCTGBW581LK8m7v GkAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=1FbnKtI3LwQwgUsr/g3MUa9Py+KRgg38b6IrILFDUhU=; b=iMGZBn2JHnv2wC6U9ZqHFt2je5tZYGomkvjXQYqPHMR834kadU2j+CAXEx95h1EIOq YZlAsyYfN/OddyhgWccDaavcfA+xfox8gkS8FEF6QcXTjRstQa9pbKIn/ygcq8mQCx0d J46j2mvbZkbLUBb9dZ71DLrfcW4k1aHG8KrlmcNTCblrC69jA6szCZ3dNXPnkarvhNZn zgjXttSCj9ipYvwn258NhPvkblC9yPsXsW8Ltpc95fHdbeQ/eYO1U4AnC9yHPvKQvAuP aX0iBv34ovOiCfzp1g13+/3e8r7T2XwzpqCMfk6hZJZTlTG6dr/o06grd4V1aknHc5oK Vgxg== X-Gm-Message-State: APjAAAUDejFJfMY4e6yDvUFaYRL1j6+g2sfxIuq3sR5bkHtEKfDGPK01 3xbXEPsffQxNWDtfvnlsmyY= X-Received: by 2002:a63:121b:: with SMTP id h27mr70608971pgl.335.1564053523202; Thu, 25 Jul 2019 04:18:43 -0700 (PDT) Received: from bharath12345-Inspiron-5559 ([103.110.42.34]) by smtp.gmail.com with ESMTPSA id s15sm48874992pfd.183.2019.07.25.04.18.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jul 2019 04:18:42 -0700 (PDT) Date: Thu, 25 Jul 2019 16:48:35 +0530 From: Bharath Vedartham To: Greg KH Cc: ira.weiny@intel.com, jglisse@redhat.com, Matt.Sickler@daktronics.com, jhubbard@nvidia.com, devel@driverdev.osuosl.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4] staging: kpc2000: Convert put_page to put_user_page*() Message-ID: <20190725111834.GA12517@bharath12345-Inspiron-5559> References: <20190720173214.GA4250@bharath12345-Inspiron-5559> <20190725074634.GB15090@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190725074634.GB15090@kroah.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 25, 2019 at 09:46:34AM +0200, Greg KH wrote: > On Sat, Jul 20, 2019 at 11:02:14PM +0530, Bharath Vedartham wrote: > > For pages that were retained via get_user_pages*(), release those pages > > via the new put_user_page*() routines, instead of via put_page(). > > > > This is part a tree-wide conversion, as described in commit fc1d8e7cca2d ("mm: introduce put_user_page*(), placeholder versions"). > > Please line-wrap this line. > > > > > Cc: Ira Weiny > > Cc: John Hubbard > > Cc: J?r?me Glisse > > Cc: Greg Kroah-Hartman > > Cc: Matt Sickler > > Cc: devel@driverdev.osuosl.org > > Cc: linux-kernel@vger.kernel.org > > Cc: linux-mm@kvack.org > > Reviewed-by: John Hubbard > > Signed-off-by: Bharath Vedartham > > --- > > Changes since v1 > > - Improved changelog by John's suggestion. > > - Moved logic to dirty pages below sg_dma_unmap > > and removed PageReserved check. > > Changes since v2 > > - Added back PageResevered check as suggested by John Hubbard. > > Changes since v3 > > - Changed the commit log as suggested by John. > > - Added John's Reviewed-By tag > > > > --- > > drivers/staging/kpc2000/kpc_dma/fileops.c | 17 ++++++----------- > > 1 file changed, 6 insertions(+), 11 deletions(-) > > > > diff --git a/drivers/staging/kpc2000/kpc_dma/fileops.c b/drivers/staging/kpc2000/kpc_dma/fileops.c > > index 6166587..75ad263 100644 > > --- a/drivers/staging/kpc2000/kpc_dma/fileops.c > > +++ b/drivers/staging/kpc2000/kpc_dma/fileops.c > > @@ -198,9 +198,7 @@ int kpc_dma_transfer(struct dev_private_data *priv, struct kiocb *kcb, unsigned > > sg_free_table(&acd->sgt); > > err_dma_map_sg: > > err_alloc_sg_table: > > - for (i = 0 ; i < acd->page_count ; i++){ > > - put_page(acd->user_pages[i]); > > - } > > + put_user_pages(acd->user_pages, acd->page_count); > > err_get_user_pages: > > kfree(acd->user_pages); > > err_alloc_userpages: > > @@ -221,16 +219,13 @@ void transfer_complete_cb(struct aio_cb_data *acd, size_t xfr_count, u32 flags) > > > > dev_dbg(&acd->ldev->pldev->dev, "transfer_complete_cb(acd = [%p])\n", acd); > > > > - for (i = 0 ; i < acd->page_count ; i++){ > > - if (!PageReserved(acd->user_pages[i])){ > > - set_page_dirty(acd->user_pages[i]); > > - } > > - } > > - > > dma_unmap_sg(&acd->ldev->pldev->dev, acd->sgt.sgl, acd->sgt.nents, acd->ldev->dir); > > > > - for (i = 0 ; i < acd->page_count ; i++){ > > - put_page(acd->user_pages[i]); > > + for (i = 0; i < acd->page_count; i++) { > > + if (!PageReserved(acd->user_pages[i])) > > + put_user_pages_dirty(&acd->user_pages[i], 1); > > + else > > + put_user_page(acd->user_pages[i]); > > } > > > > sg_free_table(&acd->sgt); > > -- > > 2.7.4 > > This patch can not be applied at all :( > > Can you redo it against the latest staging-next branch and resend? > > thanks, Yup. Will do that! > greg k-h