Re: [PATCH] staging: gasket: Convert get_user_pages*() --> pin_user_pages*()

2020-05-31 Thread Dan Carpenter
On Sun, May 31, 2020 at 12:53:11PM +0530, Souptick Joarder wrote: > In 2019, we introduced pin_user_pages*() and now we are converting > get_user_pages*() to the new API as appropriate. [1] & [2] could > be referred for more information. > > [1] Documentation/core-api/pin_user_pages.rst > > [2]

[PATCH] staging: gasket: Convert get_user_pages*() --> pin_user_pages*()

2020-05-31 Thread Souptick Joarder
In 2019, we introduced pin_user_pages*() and now we are converting get_user_pages*() to the new API as appropriate. [1] & [2] could be referred for more information. [1] Documentation/core-api/pin_user_pages.rst [2] "Explicit pinning of user-space pages": https://lwn.net/Articles/807108/

Re: [PATCH] staging: gasket: Convert get_user_pages*() --> pin_user_pages*()

2020-05-29 Thread John Hubbard
On 2020-05-29 04:53, Dan Carpenter wrote: ... What are the runtime implications of this patch? I'm still not clear on that honestly. Instead of incrementing each page's refcount by 1 (with get_user_pages()), pin_user_pages*() will increment by GUP_PIN_COUNTING_BIAS, which is 1024. That by

Re: [PATCH] staging: gasket: Convert get_user_pages*() --> pin_user_pages*()

2020-05-29 Thread Dan Carpenter
Anyway, can you resend with the commit message re-written. To me the information that's most useful is from the lwn article: "In short, if pages are being pinned for access to the data contained within those pages, pin_user_pages() should be used. For cases where the intent is to

Re: [PATCH] staging: gasket: Convert get_user_pages*() --> pin_user_pages*()

2020-05-29 Thread John Hubbard
On 2020-05-29 00:46, Dan Carpenter wrote: On Fri, May 29, 2020 at 11:57:09AM +0530, Souptick Joarder wrote: On Fri, May 29, 2020 at 11:46 AM Souptick Joarder wrote: On Thu, May 28, 2020 at 4:34 PM Dan Carpenter wrote: On Thu, May 28, 2020 at 02:32:42AM +0530, Souptick Joarder wrote: This

Re: [PATCH] staging: gasket: Convert get_user_pages*() --> pin_user_pages*()

2020-05-29 Thread Dan Carpenter
On Fri, May 29, 2020 at 11:57:09AM +0530, Souptick Joarder wrote: > On Fri, May 29, 2020 at 11:46 AM Souptick Joarder > wrote: > > > > On Thu, May 28, 2020 at 4:34 PM Dan Carpenter > > wrote: > > > > > > On Thu, May 28, 2020 at 02:32:42AM +0530, Souptick Joarder wrote: > > > > This code was

Re: [PATCH] staging: gasket: Convert get_user_pages*() --> pin_user_pages*()

2020-05-29 Thread Dan Carpenter
On Fri, May 29, 2020 at 12:38:20AM -0700, John Hubbard wrote: > On 2020-05-28 23:27, Souptick Joarder wrote: > > On Fri, May 29, 2020 at 11:46 AM Souptick Joarder > > wrote: > > > > > > On Thu, May 28, 2020 at 4:34 PM Dan Carpenter > > > wrote: > > > > > > > > On Thu, May 28, 2020 at

Re: [PATCH] staging: gasket: Convert get_user_pages*() --> pin_user_pages*()

2020-05-29 Thread John Hubbard
On 2020-05-28 23:27, Souptick Joarder wrote: On Fri, May 29, 2020 at 11:46 AM Souptick Joarder wrote: On Thu, May 28, 2020 at 4:34 PM Dan Carpenter wrote: On Thu, May 28, 2020 at 02:32:42AM +0530, Souptick Joarder wrote: This code was using get_user_pages_fast(), in a "Case 2" scenario

Re: [PATCH] staging: gasket: Convert get_user_pages*() --> pin_user_pages*()

2020-05-29 Thread Souptick Joarder
On Fri, May 29, 2020 at 11:46 AM Souptick Joarder wrote: > > On Thu, May 28, 2020 at 4:34 PM Dan Carpenter > wrote: > > > > On Thu, May 28, 2020 at 02:32:42AM +0530, Souptick Joarder wrote: > > > This code was using get_user_pages_fast(), in a "Case 2" scenario > > > (DMA/RDMA), using the

Re: [PATCH] staging: gasket: Convert get_user_pages*() --> pin_user_pages*()

2020-05-29 Thread Souptick Joarder
On Thu, May 28, 2020 at 4:34 PM Dan Carpenter wrote: > > On Thu, May 28, 2020 at 02:32:42AM +0530, Souptick Joarder wrote: > > This code was using get_user_pages_fast(), in a "Case 2" scenario > > (DMA/RDMA), using the categorization from [1]. That means that it's > > time to convert the

Re: [PATCH] staging: gasket: Convert get_user_pages*() --> pin_user_pages*()

2020-05-28 Thread Dan Carpenter
On Thu, May 28, 2020 at 02:32:42AM +0530, Souptick Joarder wrote: > This code was using get_user_pages_fast(), in a "Case 2" scenario > (DMA/RDMA), using the categorization from [1]. That means that it's > time to convert the get_user_pages_fast() + put_page() calls to > pin_user_pages_fast() +

[PATCH] staging: gasket: Convert get_user_pages*() --> pin_user_pages*()

2020-05-27 Thread Souptick Joarder
This code was using get_user_pages_fast(), in a "Case 2" scenario (DMA/RDMA), using the categorization from [1]. That means that it's time to convert the get_user_pages_fast() + put_page() calls to pin_user_pages_fast() + unpin_user_page() calls. There is some helpful background in [2]: