From: Christoph Hellwig <hch@lst.de>
To: john.hubbard@gmail.com
Cc: Andrew Morton <akpm@linux-foundation.org>,
Al Viro <viro@zeniv.linux.org.uk>,
Christian Benvenuti <benve@cisco.com>,
Christoph Hellwig <hch@infradead.org>,
Dan Williams <dan.j.williams@intel.com>,
"Darrick J . Wong" <darrick.wong@oracle.com>,
Dave Chinner <david@fromorbit.com>,
Ira Weiny <ira.weiny@intel.com>, Jan Kara <jack@suse.cz>,
Jason Gunthorpe <jgg@ziepe.ca>, Jens Axboe <axboe@kernel.dk>,
Jerome Glisse <jglisse@redhat.com>,
"Kirill A . Shutemov" <kirill@shutemov.name>,
Matthew Wilcox <willy@infradead.org>,
Michal Hocko <mhocko@kernel.org>,
Mike Marciniszyn <mike.marciniszyn@intel.com>,
Mike Rapoport <rppt@linux.ibm.com>,
linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-mm@kvack.org, linux-xfs@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
John Hubbard <jhubbard@nvidia.com>,
Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH v4 1/3] mm/gup: add make_dirty arg to put_user_pages_dirty_lock()
Date: Thu, 1 Aug 2019 08:07:55 +0200 [thread overview]
Message-ID: <20190801060755.GA14893@lst.de> (raw)
In-Reply-To: <20190730205705.9018-2-jhubbard@nvidia.com>
On Tue, Jul 30, 2019 at 01:57:03PM -0700, john.hubbard@gmail.com wrote:
> @@ -40,10 +40,7 @@
> static void __qib_release_user_pages(struct page **p, size_t num_pages,
> int dirty)
> {
> - if (dirty)
> - put_user_pages_dirty_lock(p, num_pages);
> - else
> - put_user_pages(p, num_pages);
> + put_user_pages_dirty_lock(p, num_pages, dirty);
> }
__qib_release_user_pages should be removed now as a direct call to
put_user_pages_dirty_lock is a lot more clear.
> index 0b0237d41613..62e6ffa9ad78 100644
> --- a/drivers/infiniband/hw/usnic/usnic_uiom.c
> +++ b/drivers/infiniband/hw/usnic/usnic_uiom.c
> @@ -75,10 +75,7 @@ static void usnic_uiom_put_pages(struct list_head *chunk_list, int dirty)
> for_each_sg(chunk->page_list, sg, chunk->nents, i) {
> page = sg_page(sg);
> pa = sg_phys(sg);
> - if (dirty)
> - put_user_pages_dirty_lock(&page, 1);
> - else
> - put_user_page(page);
> + put_user_pages_dirty_lock(&page, 1, dirty);
> usnic_dbg("pa: %pa\n", &pa);
There is a pre-existing bug here, as this needs to use the sg_page
iterator. Probably worth throwing in a fix into your series while you
are at it.
> @@ -63,15 +63,7 @@ struct siw_mem *siw_mem_id2obj(struct siw_device *sdev, int stag_index)
> static void siw_free_plist(struct siw_page_chunk *chunk, int num_pages,
> bool dirty)
> {
> - struct page **p = chunk->plist;
> -
> - while (num_pages--) {
> - if (!PageDirty(*p) && dirty)
> - put_user_pages_dirty_lock(p, 1);
> - else
> - put_user_page(*p);
> - p++;
> - }
> + put_user_pages_dirty_lock(chunk->plist, num_pages, dirty);
siw_free_plist should just go away now.
Otherwise this looks good to me.
next prev parent reply other threads:[~2019-08-01 6:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-30 20:57 [PATCH v4 0/3] mm/gup: add make_dirty arg to put_user_pages_dirty_lock() john.hubbard
2019-07-30 20:57 ` [PATCH v4 1/3] " john.hubbard
2019-08-01 6:07 ` Christoph Hellwig [this message]
2019-08-01 7:01 ` John Hubbard
2019-08-01 7:01 ` John Hubbard
2019-08-01 14:19 ` Jason Gunthorpe
2019-08-01 16:34 ` Christoph Hellwig
2019-07-30 20:57 ` [PATCH v4 2/3] drivers/gpu/drm/via: convert put_page() to put_user_page*() john.hubbard
2019-07-30 20:57 ` john.hubbard
2019-07-30 20:57 ` [PATCH v4 3/3] net/xdp: " john.hubbard
2019-07-31 6:08 ` Björn Töpel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190801060755.GA14893@lst.de \
--to=hch@lst.de \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=benve@cisco.com \
--cc=dan.j.williams@intel.com \
--cc=darrick.wong@oracle.com \
--cc=david@fromorbit.com \
--cc=hch@infradead.org \
--cc=ira.weiny@intel.com \
--cc=jack@suse.cz \
--cc=jgg@ziepe.ca \
--cc=jglisse@redhat.com \
--cc=jhubbard@nvidia.com \
--cc=john.hubbard@gmail.com \
--cc=kirill@shutemov.name \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-xfs@vger.kernel.org \
--cc=mhocko@kernel.org \
--cc=mike.marciniszyn@intel.com \
--cc=rppt@linux.ibm.com \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.