Re: [PATCH 1/2] vmsplice: unmap gifted pages for recipient

2013-10-18 Thread Vlastimil Babka
On 10/17/2013 03:48 PM, Robert Jennings wrote: > * Vlastimil Babka (vba...@suse.cz) wrote: >> On 10/07/2013 10:21 PM, Robert C Jennings wrote: >>> Introduce use of the unused SPLICE_F_MOVE flag for vmsplice to zap >>> pages. >>> >>> When vmsplice is called with flags (SPLICE_F_GIFT |

Re: [PATCH 1/2] vmsplice: unmap gifted pages for recipient

2013-10-18 Thread Vlastimil Babka
On 10/17/2013 03:48 PM, Robert Jennings wrote: * Vlastimil Babka (vba...@suse.cz) wrote: On 10/07/2013 10:21 PM, Robert C Jennings wrote: Introduce use of the unused SPLICE_F_MOVE flag for vmsplice to zap pages. When vmsplice is called with flags (SPLICE_F_GIFT | SPLICE_F_MOVE) the writer's

Re: [PATCH 1/2] vmsplice: unmap gifted pages for recipient

2013-10-17 Thread Robert Jennings
* Dave Hansen (d...@sr71.net) wrote: > On 10/07/2013 01:21 PM, Robert C Jennings wrote: > > spd.partial[page_nr].offset = loff; > > spd.partial[page_nr].len = this_len; > > + spd.partial[page_nr].useraddr = index << PAGE_CACHE_SHIFT; > > len -=

Re: [PATCH 1/2] vmsplice: unmap gifted pages for recipient

2013-10-17 Thread Robert Jennings
* Vlastimil Babka (vba...@suse.cz) wrote: > On 10/07/2013 10:21 PM, Robert C Jennings wrote: > > Introduce use of the unused SPLICE_F_MOVE flag for vmsplice to zap > > pages. > > > > When vmsplice is called with flags (SPLICE_F_GIFT | SPLICE_F_MOVE) the > > writer's gift'ed pages would be zapped.

Re: [PATCH 1/2] vmsplice: unmap gifted pages for recipient

2013-10-17 Thread Vlastimil Babka
On 10/07/2013 10:21 PM, Robert C Jennings wrote: > Introduce use of the unused SPLICE_F_MOVE flag for vmsplice to zap > pages. > > When vmsplice is called with flags (SPLICE_F_GIFT | SPLICE_F_MOVE) the > writer's gift'ed pages would be zapped. This patch supports further work > to move

Re: [PATCH 1/2] vmsplice: unmap gifted pages for recipient

2013-10-17 Thread Vlastimil Babka
On 10/07/2013 10:21 PM, Robert C Jennings wrote: Introduce use of the unused SPLICE_F_MOVE flag for vmsplice to zap pages. When vmsplice is called with flags (SPLICE_F_GIFT | SPLICE_F_MOVE) the writer's gift'ed pages would be zapped. This patch supports further work to move vmsplice'd

Re: [PATCH 1/2] vmsplice: unmap gifted pages for recipient

2013-10-17 Thread Robert Jennings
* Vlastimil Babka (vba...@suse.cz) wrote: On 10/07/2013 10:21 PM, Robert C Jennings wrote: Introduce use of the unused SPLICE_F_MOVE flag for vmsplice to zap pages. When vmsplice is called with flags (SPLICE_F_GIFT | SPLICE_F_MOVE) the writer's gift'ed pages would be zapped. This

Re: [PATCH 1/2] vmsplice: unmap gifted pages for recipient

2013-10-17 Thread Robert Jennings
* Dave Hansen (d...@sr71.net) wrote: On 10/07/2013 01:21 PM, Robert C Jennings wrote: spd.partial[page_nr].offset = loff; spd.partial[page_nr].len = this_len; + spd.partial[page_nr].useraddr = index PAGE_CACHE_SHIFT; len -= this_len;

Re: [PATCH 1/2] vmsplice: unmap gifted pages for recipient

2013-10-08 Thread Dave Hansen
On 10/08/2013 12:48 PM, Robert Jennings wrote: > * Dave Hansen (d...@sr71.net) wrote: >> On 10/07/2013 01:21 PM, Robert C Jennings wrote: >>> + } else { >>> + if (vma) >>> +

Re: [PATCH 1/2] vmsplice: unmap gifted pages for recipient

2013-10-08 Thread Robert Jennings
* Dave Hansen (d...@sr71.net) wrote: > On 10/07/2013 01:21 PM, Robert C Jennings wrote: > > + } else { > > + if (vma) > > + zap_page_range(vma, > > +

Re: [PATCH 1/2] vmsplice: unmap gifted pages for recipient

2013-10-08 Thread Dave Hansen
On 10/07/2013 01:21 PM, Robert C Jennings wrote: > spd.partial[page_nr].offset = loff; > spd.partial[page_nr].len = this_len; > + spd.partial[page_nr].useraddr = index << PAGE_CACHE_SHIFT; > len -= this_len; > loff = 0; >

Re: [PATCH 1/2] vmsplice: unmap gifted pages for recipient

2013-10-08 Thread Dave Hansen
On 10/07/2013 01:21 PM, Robert C Jennings wrote: > + } else { > + if (vma) > + zap_page_range(vma, > +

Re: [PATCH 1/2] vmsplice: unmap gifted pages for recipient

2013-10-08 Thread Dave Hansen
On 10/07/2013 01:21 PM, Robert C Jennings wrote: + } else { + if (vma) + zap_page_range(vma, +

Re: [PATCH 1/2] vmsplice: unmap gifted pages for recipient

2013-10-08 Thread Dave Hansen
On 10/07/2013 01:21 PM, Robert C Jennings wrote: spd.partial[page_nr].offset = loff; spd.partial[page_nr].len = this_len; + spd.partial[page_nr].useraddr = index PAGE_CACHE_SHIFT; len -= this_len; loff = 0;

Re: [PATCH 1/2] vmsplice: unmap gifted pages for recipient

2013-10-08 Thread Robert Jennings
* Dave Hansen (d...@sr71.net) wrote: On 10/07/2013 01:21 PM, Robert C Jennings wrote: + } else { + if (vma) + zap_page_range(vma, +

Re: [PATCH 1/2] vmsplice: unmap gifted pages for recipient

2013-10-08 Thread Dave Hansen
On 10/08/2013 12:48 PM, Robert Jennings wrote: * Dave Hansen (d...@sr71.net) wrote: On 10/07/2013 01:21 PM, Robert C Jennings wrote: + } else { + if (vma) +

[PATCH 1/2] vmsplice: unmap gifted pages for recipient

2013-10-07 Thread Robert C Jennings
Introduce use of the unused SPLICE_F_MOVE flag for vmsplice to zap pages. When vmsplice is called with flags (SPLICE_F_GIFT | SPLICE_F_MOVE) the writer's gift'ed pages would be zapped. This patch supports further work to move vmsplice'd pages rather than copying them. That patch has the

[PATCH 1/2] vmsplice: unmap gifted pages for recipient

2013-10-07 Thread Robert C Jennings
Introduce use of the unused SPLICE_F_MOVE flag for vmsplice to zap pages. When vmsplice is called with flags (SPLICE_F_GIFT | SPLICE_F_MOVE) the writer's gift'ed pages would be zapped. This patch supports further work to move vmsplice'd pages rather than copying them. That patch has the

Re: [RFC PATCH 1/2] vmsplice unmap gifted pages for recipient

2013-07-26 Thread Dave Hansen
On 07/26/2013 08:16 AM, Robert Jennings wrote: >>> > > + if ((spd->flags & SPLICE_F_MOVE) && >>> > > + !buf->offset && (buf->len == >>> > > PAGE_SIZE)) >>> > > + /* Can move page aligned buf */

Re: [RFC PATCH 1/2] vmsplice unmap gifted pages for recipient

2013-07-26 Thread Robert Jennings
* Dave Hansen (d...@sr71.net) wrote: > On 07/25/2013 10:21 AM, Robert Jennings wrote: > > +static void zap_buf_page(unsigned long useraddr) > > +{ > > + struct vm_area_struct *vma; > > + > > + down_read(>mm->mmap_sem); > > + vma = find_vma_intersection(current->mm, useraddr, > > +

Re: [RFC PATCH 1/2] vmsplice unmap gifted pages for recipient

2013-07-26 Thread Robert Jennings
* Dave Hansen (d...@sr71.net) wrote: On 07/25/2013 10:21 AM, Robert Jennings wrote: +static void zap_buf_page(unsigned long useraddr) +{ + struct vm_area_struct *vma; + + down_read(current-mm-mmap_sem); + vma = find_vma_intersection(current-mm, useraddr, +

Re: [RFC PATCH 1/2] vmsplice unmap gifted pages for recipient

2013-07-26 Thread Dave Hansen
On 07/26/2013 08:16 AM, Robert Jennings wrote: + if ((spd-flags SPLICE_F_MOVE) + !buf-offset (buf-len == PAGE_SIZE)) + /* Can move page aligned buf */ +

Re: [RFC PATCH 1/2] vmsplice unmap gifted pages for recipient

2013-07-25 Thread Dave Hansen
On 07/25/2013 10:21 AM, Robert Jennings wrote: > +static void zap_buf_page(unsigned long useraddr) > +{ > + struct vm_area_struct *vma; > + > + down_read(>mm->mmap_sem); > + vma = find_vma_intersection(current->mm, useraddr, > + useraddr + PAGE_SIZE); > + if

[RFC PATCH 1/2] vmsplice unmap gifted pages for recipient

2013-07-25 Thread Robert Jennings
From: Matt Helsley Introduce use of the unused SPLICE_F_MOVE flag for vmsplice to zap pages. When vmsplice is called with flags (SPLICE_F_GIFT | SPLICE_F_MOVE) the writer's gift'ed pages would be zapped. This patch supports further work to move vmsplice'd pages rather than copying them. That

[RFC PATCH 1/2] vmsplice unmap gifted pages for recipient

2013-07-25 Thread Robert Jennings
From: Matt Helsley matth...@us.ibm.com Introduce use of the unused SPLICE_F_MOVE flag for vmsplice to zap pages. When vmsplice is called with flags (SPLICE_F_GIFT | SPLICE_F_MOVE) the writer's gift'ed pages would be zapped. This patch supports further work to move vmsplice'd pages rather than

Re: [RFC PATCH 1/2] vmsplice unmap gifted pages for recipient

2013-07-25 Thread Dave Hansen
On 07/25/2013 10:21 AM, Robert Jennings wrote: +static void zap_buf_page(unsigned long useraddr) +{ + struct vm_area_struct *vma; + + down_read(current-mm-mmap_sem); + vma = find_vma_intersection(current-mm, useraddr, + useraddr + PAGE_SIZE); + if