* [PATCH] fs/io_uring.c: convert put_page() to put_user_page*()
@ 2019-08-05 2:32 john.hubbard
2019-08-05 3:44 ` Jens Axboe
2019-08-05 22:04 ` Ira Weiny
0 siblings, 2 replies; 5+ messages in thread
From: john.hubbard @ 2019-08-05 2:32 UTC (permalink / raw)
To: Andrew Morton
Cc: Christoph Hellwig, Ira Weiny, Jan Kara, Jason Gunthorpe,
Jerome Glisse, LKML, linux-mm, linux-fsdevel, John Hubbard,
Alexander Viro, Jens Axboe, linux-block
From: John Hubbard <jhubbard@nvidia.com>
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 <viro@zeniv.linux.org.uk>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: linux-fsdevel@vger.kernel.org
Cc: linux-block@vger.kernel.org
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
---
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] fs/io_uring.c: convert put_page() to put_user_page*()
2019-08-05 2:32 [PATCH] fs/io_uring.c: convert put_page() to put_user_page*() john.hubbard
@ 2019-08-05 3:44 ` Jens Axboe
2019-08-05 22:04 ` Ira Weiny
1 sibling, 0 replies; 5+ messages in thread
From: Jens Axboe @ 2019-08-05 3:44 UTC (permalink / raw)
To: john.hubbard, Andrew Morton
Cc: Christoph Hellwig, Ira Weiny, Jan Kara, Jason Gunthorpe,
Jerome Glisse, LKML, linux-mm, linux-fsdevel, John Hubbard,
Alexander Viro, linux-block
On 8/4/19 7:32 PM, john.hubbard@gmail.com wrote:
> From: John Hubbard <jhubbard@nvidia.com>
>
> 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").
Applied for 5.4, thanks.
--
Jens Axboe
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] fs/io_uring.c: convert put_page() to put_user_page*()
2019-08-05 2:32 [PATCH] fs/io_uring.c: convert put_page() to put_user_page*() john.hubbard
2019-08-05 3:44 ` Jens Axboe
@ 2019-08-05 22:04 ` Ira Weiny
2019-08-05 22:05 ` Ira Weiny
1 sibling, 1 reply; 5+ messages in thread
From: Ira Weiny @ 2019-08-05 22:04 UTC (permalink / raw)
To: john.hubbard
Cc: Andrew Morton, Christoph Hellwig, Jan Kara, Jason Gunthorpe,
Jerome Glisse, LKML, linux-mm, linux-fsdevel, John Hubbard,
Alexander Viro, Jens Axboe, linux-block
On Sun, Aug 04, 2019 at 07:32:06PM -0700, john.hubbard@gmail.com wrote:
> From: John Hubbard <jhubbard@nvidia.com>
>
> 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 <viro@zeniv.linux.org.uk>
> Cc: Jens Axboe <axboe@kernel.dk>
> Cc: linux-fsdevel@vger.kernel.org
> Cc: linux-block@vger.kernel.org
> Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
> ---
> 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
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] fs/io_uring.c: convert put_page() to put_user_page*()
2019-08-05 22:04 ` Ira Weiny
@ 2019-08-05 22:05 ` Ira Weiny
2019-08-05 22:12 ` John Hubbard
0 siblings, 1 reply; 5+ messages in thread
From: Ira Weiny @ 2019-08-05 22:05 UTC (permalink / raw)
To: john.hubbard
Cc: Andrew Morton, Christoph Hellwig, Jan Kara, Jason Gunthorpe,
Jerome Glisse, LKML, linux-mm, linux-fsdevel, John Hubbard,
Alexander Viro, Jens Axboe, linux-block
On Mon, Aug 05, 2019 at 03:04:42PM -0700, 'Ira Weiny' wrote:
> On Sun, Aug 04, 2019 at 07:32:06PM -0700, john.hubbard@gmail.com wrote:
> > From: John Hubbard <jhubbard@nvidia.com>
> >
> > 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 <viro@zeniv.linux.org.uk>
> > Cc: Jens Axboe <axboe@kernel.dk>
> > Cc: linux-fsdevel@vger.kernel.org
> > Cc: linux-block@vger.kernel.org
> > Signed-off-by: John Hubbard <jhubbard@nvidia.com>
>
> Signed-off-by: Ira Weiny <ira.weiny@intel.com>
<sigh>
I meant to say I wrote the same patch ... For this one...
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
>
> > ---
> > 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
> >
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] fs/io_uring.c: convert put_page() to put_user_page*()
2019-08-05 22:05 ` Ira Weiny
@ 2019-08-05 22:12 ` John Hubbard
0 siblings, 0 replies; 5+ messages in thread
From: John Hubbard @ 2019-08-05 22:12 UTC (permalink / raw)
To: Ira Weiny, john.hubbard
Cc: Andrew Morton, Christoph Hellwig, Jan Kara, Jason Gunthorpe,
Jerome Glisse, LKML, linux-mm, linux-fsdevel, Alexander Viro,
Jens Axboe, linux-block
On 8/5/19 3:05 PM, Ira Weiny wrote:
> On Mon, Aug 05, 2019 at 03:04:42PM -0700, 'Ira Weiny' wrote:
>> On Sun, Aug 04, 2019 at 07:32:06PM -0700, john.hubbard@gmail.com wrote:
>>> From: John Hubbard <jhubbard@nvidia.com>
>>>
>>> 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 <viro@zeniv.linux.org.uk>
>>> Cc: Jens Axboe <axboe@kernel.dk>
>>> Cc: linux-fsdevel@vger.kernel.org
>>> Cc: linux-block@vger.kernel.org
>>> Signed-off-by: John Hubbard <jhubbard@nvidia.com>
>>
>> Signed-off-by: Ira Weiny <ira.weiny@intel.com>
>
> <sigh>
>
> I meant to say I wrote the same patch ... For this one...
>
> Reviewed-by: Ira Weiny <ira.weiny@intel.com>
>
Hi Ira,
Say, in case you or anyone else is up for it: there are still about
two thirds of the 34 patches that could use a reviewed-by, in this series:
https://lore.kernel.org/r/20190804224915.28669-1-jhubbard@nvidia.com
...and even reviewing one or two quick ones would help--no need to look at
all of them, especially if several people each look at a few.
Also note that I'm keeping the gup_dma_core branch tracking the latest
linux.git, and it seems to be working pretty well, aside from one warning
that I haven't yet figured out (as per the latest commit):
git@github.com:johnhubbard/linux.git
thanks,
--
John Hubbard
NVIDIA
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-08-05 22:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-05 2:32 [PATCH] fs/io_uring.c: convert put_page() to put_user_page*() john.hubbard
2019-08-05 3:44 ` Jens Axboe
2019-08-05 22:04 ` Ira Weiny
2019-08-05 22:05 ` Ira Weiny
2019-08-05 22:12 ` John Hubbard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).