Re: [PATCH v2] RDMA/umem: minor bug fix and cleanup in error handling paths

2019-03-05 Thread John Hubbard
On 3/5/19 5:51 PM, Jason Gunthorpe wrote: > On Tue, Mar 05, 2019 at 05:37:18PM -0800, John Hubbard wrote: >> On 3/5/19 5:34 PM, John Hubbard wrote: >> [snip] > So release_pages(&local_page_list[j+1], npages - j-1) would be correct. Someone send a fixup patch please... Jason

Re: [PATCH v2] RDMA/umem: minor bug fix and cleanup in error handling paths

2019-03-05 Thread Jason Gunthorpe
On Tue, Mar 05, 2019 at 05:37:18PM -0800, John Hubbard wrote: > On 3/5/19 5:34 PM, John Hubbard wrote: > [snip] > >>> So release_pages(&local_page_list[j+1], npages - j-1) would be correct. > >> > >> Someone send a fixup patch please... > >> > >> Jason > > > > Yeah, I'm on it. Just need to double-

Re: [PATCH v2] RDMA/umem: minor bug fix and cleanup in error handling paths

2019-03-05 Thread John Hubbard
On 3/5/19 5:34 PM, John Hubbard wrote: [snip] >>> So release_pages(&local_page_list[j+1], npages - j-1) would be correct. >> >> Someone send a fixup patch please... >> >> Jason > > Yeah, I'm on it. Just need to double-check that this is the case. But Jason, > you're confirming it already, so that

Re: [PATCH v2] RDMA/umem: minor bug fix and cleanup in error handling paths

2019-03-05 Thread John Hubbard
On 3/5/19 5:32 PM, Jason Gunthorpe wrote: > On Wed, Mar 06, 2019 at 03:02:36AM +0200, Artemy Kovalyov wrote: >> >> >> On 04/03/2019 00:37, John Hubbard wrote: >>> On 3/3/19 1:52 AM, Artemy Kovalyov wrote: On 02/03/2019 21:44, Ira Weiny wrote: > > On Sat, Mar 02, 2019 at 12:24

Re: [PATCH v2] RDMA/umem: minor bug fix and cleanup in error handling paths

2019-03-05 Thread Jason Gunthorpe
On Wed, Mar 06, 2019 at 03:02:36AM +0200, Artemy Kovalyov wrote: > > > On 04/03/2019 00:37, John Hubbard wrote: > > On 3/3/19 1:52 AM, Artemy Kovalyov wrote: > > > > > > > > > On 02/03/2019 21:44, Ira Weiny wrote: > > > > > > > > On Sat, Mar 02, 2019 at 12:24:35PM -0800, john.hubb...@gmail.com

Re: [PATCH v2] RDMA/umem: minor bug fix and cleanup in error handling paths

2019-03-05 Thread Artemy Kovalyov
On 04/03/2019 00:37, John Hubbard wrote: On 3/3/19 1:52 AM, Artemy Kovalyov wrote: On 02/03/2019 21:44, Ira Weiny wrote: On Sat, Mar 02, 2019 at 12:24:35PM -0800, john.hubb...@gmail.com wrote: From: John Hubbard ... OK, thanks for explaining! Artemy, while you're here, any thoughts a

Re: [PATCH v2] RDMA/umem: minor bug fix and cleanup in error handling paths

2019-03-05 Thread John Hubbard
On 3/4/19 12:13 PM, Ira Weiny wrote: [snip] >> And this reminds me that I have a problem to solve nearby: get_user_pages >> on huge pages increments the page->_refcount *for each tail page* as well. >> That's a minor problem for my put_user_page() >> patchset, because my approach so far assumed th

Re: [PATCH v2] RDMA/umem: minor bug fix and cleanup in error handling paths

2019-03-04 Thread Ira Weiny
On Mon, Mar 04, 2019 at 03:11:05PM -0800, John Hubbard wrote: > On 3/3/19 8:55 AM, Ira Weiny wrote: > > On Sun, Mar 03, 2019 at 11:52:41AM +0200, Artemy Kovalyov wrote: > >> > >> > >> On 02/03/2019 21:44, Ira Weiny wrote: > >>> > >>> On Sat, Mar 02, 2019 at 12:24:35PM -0800, john.hubb...@gmail.com

Re: [PATCH v2] RDMA/umem: minor bug fix and cleanup in error handling paths

2019-03-04 Thread Jason Gunthorpe
On Mon, Mar 04, 2019 at 03:11:05PM -0800, John Hubbard wrote: > get_user_page(): increments page->_refcount by a large amount (1024) > > put_user_page(): decrements page->_refcount by a large amount (1024) > > ...and just stop doing the odd (to me) technique of incrementing once for > each tail

Re: [PATCH v2] RDMA/umem: minor bug fix and cleanup in error handling paths

2019-03-04 Thread John Hubbard
On 3/4/19 3:11 PM, John Hubbard wrote: > On 3/3/19 8:55 AM, Ira Weiny wrote: >> On Sun, Mar 03, 2019 at 11:52:41AM +0200, Artemy Kovalyov wrote: >>> >>> >>> On 02/03/2019 21:44, Ira Weiny wrote: On Sat, Mar 02, 2019 at 12:24:35PM -0800, john.hubb...@gmail.com wrote: > From: John Hubba

Re: [PATCH v2] RDMA/umem: minor bug fix and cleanup in error handling paths

2019-03-04 Thread John Hubbard
On 3/3/19 8:55 AM, Ira Weiny wrote: > On Sun, Mar 03, 2019 at 11:52:41AM +0200, Artemy Kovalyov wrote: >> >> >> On 02/03/2019 21:44, Ira Weiny wrote: >>> >>> On Sat, Mar 02, 2019 at 12:24:35PM -0800, john.hubb...@gmail.com wrote: From: John Hubbard ... 3. Dead code removal: the

Re: [PATCH v2] RDMA/umem: minor bug fix and cleanup in error handling paths

2019-03-03 Thread Leon Romanovsky
On Sun, Mar 03, 2019 at 02:37:33PM -0800, John Hubbard wrote: > On 3/3/19 1:52 AM, Artemy Kovalyov wrote: > > > > > > On 02/03/2019 21:44, Ira Weiny wrote: > > > > > > On Sat, Mar 02, 2019 at 12:24:35PM -0800, john.hubb...@gmail.com wrote: > > > > From: John Hubbard > > > > > > > > ... > > > > 3.

Re: [PATCH v2] RDMA/umem: minor bug fix and cleanup in error handling paths

2019-03-03 Thread Ira Weiny
On Sun, Mar 03, 2019 at 11:52:41AM +0200, Artemy Kovalyov wrote: > > > On 02/03/2019 21:44, Ira Weiny wrote: > > > > On Sat, Mar 02, 2019 at 12:24:35PM -0800, john.hubb...@gmail.com wrote: > > > From: John Hubbard > > > > > > ... > > > 3. Dead code removal: the check for (user_virt & ~page_mas

Re: [PATCH v2] RDMA/umem: minor bug fix and cleanup in error handling paths

2019-03-03 Thread John Hubbard
On 3/3/19 1:52 AM, Artemy Kovalyov wrote: On 02/03/2019 21:44, Ira Weiny wrote: On Sat, Mar 02, 2019 at 12:24:35PM -0800, john.hubb...@gmail.com wrote: From: John Hubbard ... 3. Dead code removal: the check for (user_virt & ~page_mask) is checking for a condition that can never happen, bec

Re: [PATCH v2] RDMA/umem: minor bug fix and cleanup in error handling paths

2019-03-03 Thread Artemy Kovalyov
On 02/03/2019 21:44, Ira Weiny wrote: On Sat, Mar 02, 2019 at 12:24:35PM -0800, john.hubb...@gmail.com wrote: From: John Hubbard ... 3. Dead code removal: the check for (user_virt & ~page_mask) is checking for a condition that can never happen, because earlier: user_virt = user_virt

Re: [PATCH v2] RDMA/umem: minor bug fix and cleanup in error handling paths

2019-03-02 Thread Ira Weiny
FWIW I don't have ODP hardware either. So I can't test this either. On Sat, Mar 02, 2019 at 12:24:35PM -0800, john.hubb...@gmail.com wrote: > From: John Hubbard > > 1. Bug fix: the error handling release pages starting > at the first page that experienced an error. > > 2. Refinement: release_p

[PATCH v2] RDMA/umem: minor bug fix and cleanup in error handling paths

2019-03-02 Thread john . hubbard
From: John Hubbard 1. Bug fix: the error handling release pages starting at the first page that experienced an error. 2. Refinement: release_pages() is better than put_page() in a loop. 3. Dead code removal: the check for (user_virt & ~page_mask) is checking for a condition that can never happe