Re: [PATCH v2] mm: Introduce new function vm_insert_kmem_page

2018-10-24 Thread Souptick Joarder
On Tue, Oct 23, 2018 at 6:29 PM Matthew Wilcox wrote: > > On Tue, Oct 23, 2018 at 06:03:42PM +0530, Souptick Joarder wrote: > > On Tue, Oct 23, 2018 at 5:54 PM Matthew Wilcox wrote: > > > On Tue, Oct 23, 2018 at 05:44:32PM +0530, Souptick Joarder wrote: > > > > Instruction from Matthew Wilcox wh

Re: [PATCH v2] mm: Introduce new function vm_insert_kmem_page

2018-10-24 Thread Matthew Wilcox
On Tue, Oct 23, 2018 at 06:03:42PM +0530, Souptick Joarder wrote: > On Tue, Oct 23, 2018 at 5:54 PM Matthew Wilcox wrote: > > On Tue, Oct 23, 2018 at 05:44:32PM +0530, Souptick Joarder wrote: > > > Instruction from Matthew Wilcox who is supervising the entire vm_fault_t > > > migration work :-) >

Re: [PATCH v2] mm: Introduce new function vm_insert_kmem_page

2018-10-24 Thread Souptick Joarder
On Tue, Oct 23, 2018 at 5:54 PM Matthew Wilcox wrote: > > On Tue, Oct 23, 2018 at 05:44:32PM +0530, Souptick Joarder wrote: > > On Sat, Oct 6, 2018 at 4:19 PM Miguel Ojeda > > wrote: > > > > > > On Sat, Oct 6, 2018 at 7:11 AM Souptick Joarder > > > wrote: > > > > > > > > On Fri, Oct 5, 2018 at

Re: [PATCH v2] mm: Introduce new function vm_insert_kmem_page

2018-10-24 Thread Souptick Joarder
On Sat, Oct 6, 2018 at 4:19 PM Miguel Ojeda wrote: > > On Sat, Oct 6, 2018 at 7:11 AM Souptick Joarder wrote: > > > > On Fri, Oct 5, 2018 at 11:39 PM Miguel Ojeda > > wrote: > > > They are not supposed to be "steps". You did it with 70+ commits (!!) > > > over the course of several months. Why a

Re: [PATCH v2] mm: Introduce new function vm_insert_kmem_page

2018-10-24 Thread Matthew Wilcox
On Tue, Oct 23, 2018 at 05:44:32PM +0530, Souptick Joarder wrote: > On Sat, Oct 6, 2018 at 4:19 PM Miguel Ojeda > wrote: > > > > On Sat, Oct 6, 2018 at 7:11 AM Souptick Joarder > > wrote: > > > > > > On Fri, Oct 5, 2018 at 11:39 PM Miguel Ojeda > > > wrote: > > > > They are not supposed to be "

Re: [PATCH v2] mm: Introduce new function vm_insert_kmem_page

2018-10-08 Thread Souptick Joarder
On Fri, Oct 5, 2018 at 4:19 PM Miguel Ojeda wrote: > > Hi Souptick, > > On Fri, Oct 5, 2018 at 12:01 PM Souptick Joarder wrote: > > > > The final goal is to remove vm_insert_page by converting it to > > vmf_insert_page. But to do that we have to first introduce the > > new API which is similar to

Re: [PATCH v2] mm: Introduce new function vm_insert_kmem_page

2018-10-08 Thread Miguel Ojeda
Hi Souptick, On Fri, Oct 5, 2018 at 12:01 PM Souptick Joarder wrote: > > The final goal is to remove vm_insert_page by converting it to > vmf_insert_page. But to do that we have to first introduce the > new API which is similar to vm_insert_page (for non #PF). I tried this by > introducing vm_in

Re: [PATCH v2] mm: Introduce new function vm_insert_kmem_page

2018-10-08 Thread Souptick Joarder
On Fri, Oct 5, 2018 at 11:39 PM Miguel Ojeda wrote: > > On Fri, Oct 5, 2018 at 2:11 PM Souptick Joarder wrote: > > > > On Fri, Oct 5, 2018 at 4:19 PM Miguel Ojeda > > wrote: > > > > > > 1. Introduce the vmf_* API > > > 2. Change all PF-users users to that (leaving all non-PF ones > > > untou

Re: [PATCH v2] mm: Introduce new function vm_insert_kmem_page

2018-10-08 Thread Miguel Ojeda
Hi Souptick, On Fri, Oct 5, 2018 at 7:51 AM Souptick Joarder wrote: > > On Fri, Oct 5, 2018 at 1:16 AM Miguel Ojeda > wrote: > > > > > > Also, not sure if you saw my comments/review: if the interface is not > > going to change, why the name change? Why can't we simply keep using > > vm_insert_pa

Re: [PATCH v2] mm: Introduce new function vm_insert_kmem_page

2018-10-08 Thread Miguel Ojeda
On Sat, Oct 6, 2018 at 7:11 AM Souptick Joarder wrote: > > On Fri, Oct 5, 2018 at 11:39 PM Miguel Ojeda > wrote: > > They are not supposed to be "steps". You did it with 70+ commits (!!) > > over the course of several months. Why a tree wasn't created, stuff > > developed there, and when done, su

Re: [PATCH v2] mm: Introduce new function vm_insert_kmem_page

2018-10-08 Thread Souptick Joarder
On Fri, Oct 5, 2018 at 2:22 PM Miguel Ojeda wrote: > > Hi Souptick, > > On Fri, Oct 5, 2018 at 7:51 AM Souptick Joarder wrote: > > > > On Fri, Oct 5, 2018 at 1:16 AM Miguel Ojeda > > wrote: > > > > > > > > > Also, not sure if you saw my comments/review: if the interface is not > > > going to cha

Re: [PATCH v2] mm: Introduce new function vm_insert_kmem_page

2018-10-08 Thread Miguel Ojeda
On Fri, Oct 5, 2018 at 2:11 PM Souptick Joarder wrote: > > On Fri, Oct 5, 2018 at 4:19 PM Miguel Ojeda > wrote: > > > > 1. Introduce the vmf_* API > > 2. Change all PF-users users to that (leaving all non-PF ones > > untouched!) -- if this is too big, you can split this patch into > > several

Re: [PATCH v2] mm: Introduce new function vm_insert_kmem_page

2018-10-05 Thread Souptick Joarder
On Thu, Oct 4, 2018 at 11:47 PM Matthew Wilcox wrote: > > On Thu, Oct 04, 2018 at 11:42:18PM +0530, Souptick Joarder wrote: > > On Thu, Oct 4, 2018 at 6:04 PM Russell King - ARM Linux > > wrote: > > > I'm confused, what are you trying to do? > > > > > > It seems that we already have: > > > > > >

Re: [PATCH v2] mm: Introduce new function vm_insert_kmem_page

2018-10-05 Thread Souptick Joarder
On Fri, Oct 5, 2018 at 1:16 AM Miguel Ojeda wrote: > > Hi Souptick, > > On Thu, Oct 4, 2018 at 8:49 PM Souptick Joarder wrote: > > > > On Thu, Oct 4, 2018 at 11:47 PM Matthew Wilcox wrote: > > > > > > I think this is a bad plan. What we should rather do is examine the > > > current > > > users

Re: [PATCH v2] mm: Introduce new function vm_insert_kmem_page

2018-10-05 Thread Souptick Joarder
On Thu, Oct 4, 2018 at 1:28 AM Miguel Ojeda wrote: > > Hi Souptick, > > On Wed, Oct 3, 2018 at 8:55 PM Souptick Joarder wrote: > > > > vm_insert_kmem_page is similar to vm_insert_page and will > > be used by drivers to map kernel (kmalloc/vmalloc/pages) > > allocated memory to user vma. > > > > G

Re: [PATCH v2] mm: Introduce new function vm_insert_kmem_page

2018-10-05 Thread Matthew Wilcox
On Thu, Oct 04, 2018 at 11:42:18PM +0530, Souptick Joarder wrote: > On Thu, Oct 4, 2018 at 6:04 PM Russell King - ARM Linux > wrote: > > I'm confused, what are you trying to do? > > > > It seems that we already have: > > > > vm_insert_page() - returns an errno > > vmf_insert_page() - returns a VM_

Re: [PATCH v2] mm: Introduce new function vm_insert_kmem_page

2018-10-05 Thread Souptick Joarder
Hi Matthew, On Thu, Oct 4, 2018 at 1:30 AM Matthew Wilcox wrote: > > On Thu, Oct 04, 2018 at 12:28:54AM +0530, Souptick Joarder wrote: > > These are the approaches which could have been taken to handle > > this scenario - > > > > * Replace vm_insert_page with vmf_insert_page and then write few >

Re: [PATCH v2] mm: Introduce new function vm_insert_kmem_page

2018-10-05 Thread Miguel Ojeda
Hi Souptick, On Thu, Oct 4, 2018 at 8:49 PM Souptick Joarder wrote: > > On Thu, Oct 4, 2018 at 11:47 PM Matthew Wilcox wrote: > > > > I think this is a bad plan. What we should rather do is examine the current > > users of vm_insert_page() and ask "What interface would better replace > > vm_ins

Re: [PATCH v2] mm: Introduce new function vm_insert_kmem_page

2018-10-05 Thread Souptick Joarder
On Thu, Oct 4, 2018 at 3:45 AM Russell King - ARM Linux wrote: > > On Wed, Oct 03, 2018 at 01:00:03PM -0700, Matthew Wilcox wrote: > > On Thu, Oct 04, 2018 at 12:28:54AM +0530, Souptick Joarder wrote: > > > These are the approaches which could have been taken to handle > > > this scenario - > > >

Re: [PATCH v2] mm: Introduce new function vm_insert_kmem_page

2018-10-05 Thread Souptick Joarder
On Thu, Oct 4, 2018 at 6:04 PM Russell King - ARM Linux wrote: > > On Thu, Oct 04, 2018 at 05:45:13PM +0530, Souptick Joarder wrote: > > On Thu, Oct 4, 2018 at 3:45 AM Russell King - ARM Linux > > wrote: > > > > > > On Wed, Oct 03, 2018 at 01:00:03PM -0700, Matthew Wilcox wrote: > > > > On Thu, O

Re: [PATCH v2] mm: Introduce new function vm_insert_kmem_page

2018-10-04 Thread Russell King - ARM Linux
On Thu, Oct 04, 2018 at 05:45:13PM +0530, Souptick Joarder wrote: > On Thu, Oct 4, 2018 at 3:45 AM Russell King - ARM Linux > wrote: > > > > On Wed, Oct 03, 2018 at 01:00:03PM -0700, Matthew Wilcox wrote: > > > On Thu, Oct 04, 2018 at 12:28:54AM +0530, Souptick Joarder wrote: > > > > These are the

Re: [PATCH v2] mm: Introduce new function vm_insert_kmem_page

2018-10-04 Thread Matthew Wilcox
On Wed, Oct 03, 2018 at 11:14:45PM +0100, Russell King - ARM Linux wrote: > On Wed, Oct 03, 2018 at 01:00:03PM -0700, Matthew Wilcox wrote: > > On Thu, Oct 04, 2018 at 12:28:54AM +0530, Souptick Joarder wrote: > > > These are the approaches which could have been taken to handle > > > this scenario

Re: [PATCH v2] mm: Introduce new function vm_insert_kmem_page

2018-10-04 Thread Miguel Ojeda
Hi Souptick, On Wed, Oct 3, 2018 at 8:55 PM Souptick Joarder wrote: > > vm_insert_kmem_page is similar to vm_insert_page and will > be used by drivers to map kernel (kmalloc/vmalloc/pages) > allocated memory to user vma. > > Going forward, the plan is to restrict future drivers not > to use vm_in

[PATCH v2] mm: Introduce new function vm_insert_kmem_page

2018-10-04 Thread Souptick Joarder
vm_insert_kmem_page is similar to vm_insert_page and will be used by drivers to map kernel (kmalloc/vmalloc/pages) allocated memory to user vma. Going forward, the plan is to restrict future drivers not to use vm_insert_page ( *it will generate new errno to VM_FAULT_CODE mapping code for new drive

Re: [PATCH v2] mm: Introduce new function vm_insert_kmem_page

2018-10-04 Thread Matthew Wilcox
On Thu, Oct 04, 2018 at 12:28:54AM +0530, Souptick Joarder wrote: > These are the approaches which could have been taken to handle > this scenario - > > * Replace vm_insert_page with vmf_insert_page and then write few >extra lines of code to convert VM_FAULT_CODE to errno which >makes dri

Re: [PATCH v2] mm: Introduce new function vm_insert_kmem_page

2018-10-03 Thread Russell King - ARM Linux
On Wed, Oct 03, 2018 at 01:00:03PM -0700, Matthew Wilcox wrote: > On Thu, Oct 04, 2018 at 12:28:54AM +0530, Souptick Joarder wrote: > > These are the approaches which could have been taken to handle > > this scenario - > > > > * Replace vm_insert_page with vmf_insert_page and then write few > >