[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0e232d84-e6ea-159e-91d4-77e938377161@nvidia.com>
Date: Tue, 6 Aug 2019 13:39:16 -0700
From: John Hubbard <jhubbard@...dia.com>
To: Ira Weiny <ira.weiny@...el.com>, <john.hubbard@...il.com>
CC: Andrew Morton <akpm@...ux-foundation.org>,
Christoph Hellwig <hch@...radead.org>,
Dan Williams <dan.j.williams@...el.com>,
Dave Chinner <david@...morbit.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Jan Kara <jack@...e.cz>, Jason Gunthorpe <jgg@...pe.ca>,
Jérôme Glisse <jglisse@...hat.com>,
LKML <linux-kernel@...r.kernel.org>,
<amd-gfx@...ts.freedesktop.org>, <ceph-devel@...r.kernel.org>,
<devel@...verdev.osuosl.org>, <devel@...ts.orangefs.org>,
<dri-devel@...ts.freedesktop.org>,
<intel-gfx@...ts.freedesktop.org>, <kvm@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-block@...r.kernel.org>, <linux-crypto@...r.kernel.org>,
<linux-fbdev@...r.kernel.org>, <linux-fsdevel@...r.kernel.org>,
<linux-media@...r.kernel.org>, <linux-mm@...ck.org>,
<linux-nfs@...r.kernel.org>, <linux-rdma@...r.kernel.org>,
<linux-rpi-kernel@...ts.infradead.org>,
<linux-xfs@...r.kernel.org>, <netdev@...r.kernel.org>,
<rds-devel@....oracle.com>, <sparclinux@...r.kernel.org>,
<x86@...nel.org>, <xen-devel@...ts.xenproject.org>,
Christoph Hellwig <hch@....de>,
Matthew Wilcox <willy@...radead.org>
Subject: Re: [PATCH v2 01/34] mm/gup: add make_dirty arg to
put_user_pages_dirty_lock()
On 8/6/19 10:39 AM, Ira Weiny wrote:
> On Sun, Aug 04, 2019 at 03:48:42PM -0700, john.hubbard@...il.com wrote:
>> From: John Hubbard <jhubbard@...dia.com>
...
>> -
>> /**
>> - * 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 <ira.weiny@...el.com>
Thanks for the review!
thanks,
--
John Hubbard
NVIDIA
Powered by blists - more mailing lists