From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F01D2C32751 for ; Tue, 6 Aug 2019 20:39:22 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C198220B1F for ; Tue, 6 Aug 2019 20:39:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="P+KUFtrw"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="De7r6lQU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C198220B1F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pdc7AWApWM7PQHj/i8FrUFnLf0mysiu/2Ef6zPSr4lY=; b=P+KUFtrwvF0Gqy sggDgi/WPZSOQFIsFtAE+sA/DXilm6fZP+lcWH9OL+W6LTb+YjKq+g+veCSVFI/kwO0oi1Mw9wIUP thrpdwOiaOONJyTkplH9dED8maIhnqPCjS7fhjhzPGZYCcFswrFn7KGAo4z9jdgcx/n27G4MAXMRe +Vv08g84kUrS3Lo5FGLAoggcmpYLivYmHfT1YkEm1+3F6NPEVTmLos1T38wyKeWBuJvVXISFcSc/c oA2+Z+9o5ckMFBtCnIplSbnWcHajWPxyII8d7fjAP8rXeaXglnkGuptb91AGoY/N4fJ0lFoh9R+uE wJ95PwZQHGR5RlbiTYGA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hv6Es-0001V0-1O; Tue, 06 Aug 2019 20:39:22 +0000 Received: from hqemgate16.nvidia.com ([216.228.121.65]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hv6Eo-0001Uc-Pf; Tue, 06 Aug 2019 20:39:20 +0000 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 06 Aug 2019 13:39:18 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Tue, 06 Aug 2019 13:39:17 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 06 Aug 2019 13:39:17 -0700 Received: from [10.110.48.28] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 6 Aug 2019 20:39:16 +0000 Subject: Re: [PATCH v2 01/34] mm/gup: add make_dirty arg to put_user_pages_dirty_lock() To: Ira Weiny , References: <20190804224915.28669-1-jhubbard@nvidia.com> <20190804224915.28669-2-jhubbard@nvidia.com> <20190806173945.GA4748@iweiny-DESK2.sc.intel.com> X-Nvconfidentiality: public From: John Hubbard Message-ID: <0e232d84-e6ea-159e-91d4-77e938377161@nvidia.com> Date: Tue, 6 Aug 2019 13:39:16 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190806173945.GA4748@iweiny-DESK2.sc.intel.com> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL104.nvidia.com (172.18.146.11) To HQMAIL107.nvidia.com (172.20.187.13) Content-Language: en-US DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1565123958; bh=kP7gTuC3ZdPRsl2ZM8hKtRsMZoJPCXuUqs/7ZYFYlas=; h=X-PGP-Universal:Subject:To:CC:References:X-Nvconfidentiality:From: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=De7r6lQUtbn+GTEsMqljgVKTlQIrCw8ZESuRqc7w4LEYPASOCDyQM6KfNGQouIjYR fh0BckBJVbNT9AbXMQb66ZhMKSleBMpCp4Q67sEppT12m031guaO+mSQiN77Vubrty dLwAVLGyjRDyH8bKz/ie59UuEUjWXDBsQB9IGYcfiHyqrDkJ8dhLAwUMAPjRDqyeiY KJw8zEX2A8/HIUmoazoyVwItiLDzuGpYh0geDqgdodA5dwJzt0S2azlo+PhdmfDHXO 6GhmRkzx66GKpfVpxeAm8ztIGHTRgebRJf3i5iJHgoMtdv7J6YmmRpepQCyIfl7KA0 CyUb7h3ZsvM+w== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190806_133918_849916_CCFF472C X-CRM114-Status: GOOD ( 17.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fbdev@vger.kernel.org, Jan Kara , kvm@vger.kernel.org, Dave Hansen , Dave Chinner , dri-devel@lists.freedesktop.org, linux-mm@kvack.org, Matthew Wilcox , sparclinux@vger.kernel.org, Dan Williams , devel@driverdev.osuosl.org, rds-devel@oss.oracle.com, linux-rdma@vger.kernel.org, x86@kernel.org, amd-gfx@lists.freedesktop.org, Christoph Hellwig , Christoph Hellwig , Jason Gunthorpe , xen-devel@lists.xenproject.org, devel@lists.orangefs.org, linux-media@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-block@vger.kernel.org, =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , linux-rpi-kernel@lists.infradead.org, ceph-devel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-nfs@vger.kernel.org, netdev@vger.kernel.org, LKML , linux-xfs@vger.kernel.org, linux-crypto@vger.kernel.org, linux-fsdevel@vger.kernel.org, Andrew Morton Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 8/6/19 10:39 AM, Ira Weiny wrote: > On Sun, Aug 04, 2019 at 03:48:42PM -0700, john.hubbard@gmail.com wrote: >> From: John Hubbard ... >> - >> /** >> - * put_user_pages_dirty() - release and dirty an array of gup-pinned pages >> - * @pages: array of pages to be marked dirty and released. >> + * put_user_pages_dirty_lock() - release and optionally dirty gup-pinned pages >> + * @pages: array of pages to be maybe marked dirty, and definitely released. > > Better would be. > > @pages: array of pages to be put OK, I'll change to that wording. > >> * @npages: number of pages in the @pages array. >> + * @make_dirty: whether to mark the pages dirty >> * >> * "gup-pinned page" refers to a page that has had one of the get_user_pages() >> * variants called on that page. >> * >> * For each page in the @pages array, make that page (or its head page, if a >> - * compound page) dirty, if it was previously listed as clean. Then, release >> - * the page using put_user_page(). >> + * compound page) dirty, if @make_dirty is true, and if the page was previously >> + * listed as clean. In any case, releases all pages using put_user_page(), >> + * possibly via put_user_pages(), for the non-dirty case. > > I don't think users of this interface need this level of detail. I think > something like. > > * For each page in the @pages array, release the page. If @make_dirty is > * true, mark the page dirty prior to release. Yes, it is too wordy, I'll change to that. > ... >> -void put_user_pages_dirty_lock(struct page **pages, unsigned long npages) >> -{ >> - __put_user_pages_dirty(pages, npages, set_page_dirty_lock); >> + /* >> + * TODO: this can be optimized for huge pages: if a series of pages is >> + * physically contiguous and part of the same compound page, then a >> + * single operation to the head page should suffice. >> + */ > > I think this comment belongs to the for loop below... or just something about > how to make this and put_user_pages() more efficient. It is odd, that this is > the same comment as in put_user_pages()... Actually I think I'll just delete the comment entirely, it's just noise really. > > The code is good. So... Other than the comments. > > Reviewed-by: Ira Weiny Thanks for the review! thanks, -- John Hubbard NVIDIA _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel