Re: [PATCH 1/9] mm: Introduce new vm_insert_range API

2018-11-28 Thread Heiko Stübner
Am Donnerstag, 15. November 2018, 16:45:30 CET schrieb Souptick Joarder: > Previouly drivers have their own way of mapping range of > kernel pages/memory into user vma and this was done by > invoking vm_insert_page() within a loop. > > As this pattern is common across different drivers, it can >

Re: [PATCH 1/9] mm: Introduce new vm_insert_range API

2018-11-22 Thread Matthew Wilcox
On Wed, Nov 21, 2018 at 04:19:11AM -0700, William Kucharski wrote: > Could you add a line to the description explicitly stating that a failure > to insert any page in the range will fail the entire routine, something > like: > > > * This allows drivers to insert range of kernel pages they've

Re: [PATCH 1/9] mm: Introduce new vm_insert_range API

2018-11-22 Thread William Kucharski
> On Nov 21, 2018, at 5:35 AM, Matthew Wilcox wrote: > > It's probably better to be more explicit and answer Randy's question: > > * If we fail to insert any page into the vma, the function will return > * immediately leaving any previously-inserted pages present. Callers > * from the mmap

Re: [PATCH 1/9] mm: Introduce new vm_insert_range API

2018-11-22 Thread William Kucharski
Could you add a line to the description explicitly stating that a failure to insert any page in the range will fail the entire routine, something like: > * This allows drivers to insert range of kernel pages they've allocated > * into a user vma. This is a generic function which drivers can use >

Re: [PATCH 1/9] mm: Introduce new vm_insert_range API

2018-11-22 Thread Mike Rapoport
On Mon, Nov 19, 2018 at 11:15:15PM +0530, Souptick Joarder wrote: > On Mon, Nov 19, 2018 at 9:56 PM Mike Rapoport wrote: > > > > On Mon, Nov 19, 2018 at 08:43:09PM +0530, Souptick Joarder wrote: > > > Hi Mike, > > > > > > On Sat, Nov 17, 2018 at 8:07 PM Matthew Wilcox > > > wrote: > > > > > > >

Re: [PATCH 1/9] mm: Introduce new vm_insert_range API

2018-11-20 Thread Souptick Joarder
On Mon, Nov 19, 2018 at 9:56 PM Mike Rapoport wrote: > > On Mon, Nov 19, 2018 at 08:43:09PM +0530, Souptick Joarder wrote: > > Hi Mike, > > > > On Sat, Nov 17, 2018 at 8:07 PM Matthew Wilcox wrote: > > > > > > On Sat, Nov 17, 2018 at 12:26:38PM +0530, Souptick Joarder wrote: > > > > On Fri, Nov

Re: [PATCH 1/9] mm: Introduce new vm_insert_range API

2018-11-20 Thread Mike Rapoport
On Mon, Nov 19, 2018 at 08:43:09PM +0530, Souptick Joarder wrote: > Hi Mike, > > On Sat, Nov 17, 2018 at 8:07 PM Matthew Wilcox wrote: > > > > On Sat, Nov 17, 2018 at 12:26:38PM +0530, Souptick Joarder wrote: > > > On Fri, Nov 16, 2018 at 11:59 PM Mike Rapoport wrote: > > > > > + *

Re: [PATCH 1/9] mm: Introduce new vm_insert_range API

2018-11-20 Thread Souptick Joarder
Hi Mike, On Sat, Nov 17, 2018 at 8:07 PM Matthew Wilcox wrote: > > On Sat, Nov 17, 2018 at 12:26:38PM +0530, Souptick Joarder wrote: > > On Fri, Nov 16, 2018 at 11:59 PM Mike Rapoport wrote: > > > > + * vm_insert_range - insert range of kernel pages into user vma > > > > + * @vma: user vma to

Re: [PATCH 1/9] mm: Introduce new vm_insert_range API

2018-11-17 Thread Matthew Wilcox
On Sat, Nov 17, 2018 at 12:26:38PM +0530, Souptick Joarder wrote: > On Fri, Nov 16, 2018 at 11:59 PM Mike Rapoport wrote: > > > + * vm_insert_range - insert range of kernel pages into user vma > > > + * @vma: user vma to map to > > > + * @addr: target user address of this page > > > + * @pages:

Re: [PATCH 1/9] mm: Introduce new vm_insert_range API

2018-11-17 Thread Randy Dunlap
On 11/16/18 12:15 AM, Souptick Joarder wrote: > On Fri, Nov 16, 2018 at 12:11 PM Matthew Wilcox wrote: >> >> On Fri, Nov 16, 2018 at 11:00:30AM +0530, Souptick Joarder wrote: >>> On Thu, Nov 15, 2018 at 11:44 PM Randy Dunlap wrote: On 11/15/18 7:45 AM, Souptick Joarder wrote: What is

Re: [PATCH 1/9] mm: Introduce new vm_insert_range API

2018-11-17 Thread Mike Rapoport
On Thu, Nov 15, 2018 at 09:15:30PM +0530, Souptick Joarder wrote: > Previouly drivers have their own way of mapping range of > kernel pages/memory into user vma and this was done by > invoking vm_insert_page() within a loop. > > As this pattern is common across different drivers, it can > be

Re: [PATCH 1/9] mm: Introduce new vm_insert_range API

2018-11-17 Thread Souptick Joarder
On Fri, Nov 16, 2018 at 11:59 PM Mike Rapoport wrote: > > On Thu, Nov 15, 2018 at 09:15:30PM +0530, Souptick Joarder wrote: > > Previouly drivers have their own way of mapping range of > > kernel pages/memory into user vma and this was done by > > invoking vm_insert_page() within a loop. > > > >

Re: [PATCH 1/9] mm: Introduce new vm_insert_range API

2018-11-17 Thread Souptick Joarder
On Fri, Nov 16, 2018 at 12:11 PM Matthew Wilcox wrote: > > On Fri, Nov 16, 2018 at 11:00:30AM +0530, Souptick Joarder wrote: > > On Thu, Nov 15, 2018 at 11:44 PM Randy Dunlap wrote: > > > On 11/15/18 7:45 AM, Souptick Joarder wrote: > > > What is the opposite of vm_insert_range() or even of

Re: [PATCH 1/9] mm: Introduce new vm_insert_range API

2018-11-16 Thread Slavomir Kaslev
On Thu, Nov 15, 2018 at 5:42 PM Souptick Joarder wrote: > > Previouly drivers have their own way of mapping range of > kernel pages/memory into user vma and this was done by > invoking vm_insert_page() within a loop. > > As this pattern is common across different drivers, it can > be generalized

Re: [PATCH 1/9] mm: Introduce new vm_insert_range API

2018-11-16 Thread Souptick Joarder
On Thu, Nov 15, 2018 at 11:44 PM Randy Dunlap wrote: > > On 11/15/18 7:45 AM, Souptick Joarder wrote: > > Previouly drivers have their own way of mapping range of > > kernel pages/memory into user vma and this was done by > > invoking vm_insert_page() within a loop. > > > > As this pattern is

Re: [PATCH 1/9] mm: Introduce new vm_insert_range API

2018-11-16 Thread Matthew Wilcox
On Fri, Nov 16, 2018 at 11:00:30AM +0530, Souptick Joarder wrote: > On Thu, Nov 15, 2018 at 11:44 PM Randy Dunlap wrote: > > On 11/15/18 7:45 AM, Souptick Joarder wrote: > > What is the opposite of vm_insert_range() or even of vm_insert_page()? > > or is there no need for that? > > There is no

[PATCH 1/9] mm: Introduce new vm_insert_range API

2018-11-16 Thread Souptick Joarder
Previouly drivers have their own way of mapping range of kernel pages/memory into user vma and this was done by invoking vm_insert_page() within a loop. As this pattern is common across different drivers, it can be generalized by creating a new function and use it across the drivers.

Re: [PATCH 1/9] mm: Introduce new vm_insert_range API

2018-11-16 Thread Randy Dunlap
On 11/15/18 7:45 AM, Souptick Joarder wrote: > Previouly drivers have their own way of mapping range of > kernel pages/memory into user vma and this was done by > invoking vm_insert_page() within a loop. > > As this pattern is common across different drivers, it can > be generalized by creating a