Re: [PATCHv2, RFC 08/30] thp, mm: rewrite add_to_page_cache_locked() to support huge pages

2013-03-22 Thread Dave Hansen
On 03/22/2013 03:34 AM, Kirill A. Shutemov wrote: > Dave Hansen wrote: >> On 03/14/2013 10:50 AM, Kirill A. Shutemov wrote: >>> + error = radix_tree_insert(>page_tree, >>> + offset + i, page + i); >>> + if (error) { >>> +

Re: [PATCHv2, RFC 08/30] thp, mm: rewrite add_to_page_cache_locked() to support huge pages

2013-03-22 Thread Kirill A. Shutemov
Dave Hansen wrote: > On 03/14/2013 10:50 AM, Kirill A. Shutemov wrote: > > From: "Kirill A. Shutemov" > > > > For huge page we add to radix tree HPAGE_CACHE_NR pages at once: head > > page for the specified index and HPAGE_CACHE_NR-1 tail pages for > > following indexes. > > > > Signed-off-by:

Re: [PATCHv2, RFC 08/30] thp, mm: rewrite add_to_page_cache_locked() to support huge pages

2013-03-22 Thread Kirill A. Shutemov
Dave Hansen wrote: On 03/14/2013 10:50 AM, Kirill A. Shutemov wrote: From: Kirill A. Shutemov kirill.shute...@linux.intel.com For huge page we add to radix tree HPAGE_CACHE_NR pages at once: head page for the specified index and HPAGE_CACHE_NR-1 tail pages for following indexes.

Re: [PATCHv2, RFC 08/30] thp, mm: rewrite add_to_page_cache_locked() to support huge pages

2013-03-22 Thread Dave Hansen
On 03/22/2013 03:34 AM, Kirill A. Shutemov wrote: Dave Hansen wrote: On 03/14/2013 10:50 AM, Kirill A. Shutemov wrote: + error = radix_tree_insert(mapping-page_tree, + offset + i, page + i); + if (error) { +

Re: [PATCHv2, RFC 08/30] thp, mm: rewrite add_to_page_cache_locked() to support huge pages

2013-03-21 Thread Dave Hansen
On 03/14/2013 10:50 AM, Kirill A. Shutemov wrote: > From: "Kirill A. Shutemov" > > For huge page we add to radix tree HPAGE_CACHE_NR pages at once: head > page for the specified index and HPAGE_CACHE_NR-1 tail pages for > following indexes. > > Signed-off-by: Kirill A. Shutemov > --- >

Re: [PATCHv2, RFC 08/30] thp, mm: rewrite add_to_page_cache_locked() to support huge pages

2013-03-21 Thread Dave Hansen
On 03/14/2013 10:50 AM, Kirill A. Shutemov wrote: From: Kirill A. Shutemov kirill.shute...@linux.intel.com For huge page we add to radix tree HPAGE_CACHE_NR pages at once: head page for the specified index and HPAGE_CACHE_NR-1 tail pages for following indexes. Signed-off-by: Kirill A.

Re: [PATCHv2, RFC 08/30] thp, mm: rewrite add_to_page_cache_locked() to support huge pages

2013-03-15 Thread Kirill A. Shutemov
Hillf Danton wrote: > On Fri, Mar 15, 2013 at 9:50 PM, Kirill A. Shutemov > wrote: > > Hillf Danton wrote: > >> On Fri, Mar 15, 2013 at 9:23 PM, Kirill A. Shutemov > >> wrote: > >> > Hillf Danton wrote: > >> >> On Fri, Mar 15, 2013 at 1:50 AM, Kirill A. Shutemov > >> >> wrote: > >> >> > +

Re: [PATCHv2, RFC 08/30] thp, mm: rewrite add_to_page_cache_locked() to support huge pages

2013-03-15 Thread Hillf Danton
On Fri, Mar 15, 2013 at 9:50 PM, Kirill A. Shutemov wrote: > Hillf Danton wrote: >> On Fri, Mar 15, 2013 at 9:23 PM, Kirill A. Shutemov >> wrote: >> > Hillf Danton wrote: >> >> On Fri, Mar 15, 2013 at 1:50 AM, Kirill A. Shutemov >> >> wrote: >> >> > + page_cache_get(page); >> >> > +

Re: [PATCHv2, RFC 08/30] thp, mm: rewrite add_to_page_cache_locked() to support huge pages

2013-03-15 Thread Kirill A. Shutemov
Hillf Danton wrote: > On Fri, Mar 15, 2013 at 9:23 PM, Kirill A. Shutemov > wrote: > > Hillf Danton wrote: > >> On Fri, Mar 15, 2013 at 1:50 AM, Kirill A. Shutemov > >> wrote: > >> > + page_cache_get(page); > >> > + spin_lock_irq(>tree_lock); > >> > + page->mapping = mapping; >

Re: [PATCHv2, RFC 08/30] thp, mm: rewrite add_to_page_cache_locked() to support huge pages

2013-03-15 Thread Hillf Danton
On Fri, Mar 15, 2013 at 9:23 PM, Kirill A. Shutemov wrote: > Hillf Danton wrote: >> On Fri, Mar 15, 2013 at 1:50 AM, Kirill A. Shutemov >> wrote: >> > + page_cache_get(page); >> > + spin_lock_irq(>tree_lock); >> > + page->mapping = mapping; >> > + page->index = offset; >>

Re: [PATCHv2, RFC 08/30] thp, mm: rewrite add_to_page_cache_locked() to support huge pages

2013-03-15 Thread Kirill A. Shutemov
Hillf Danton wrote: > On Fri, Mar 15, 2013 at 1:50 AM, Kirill A. Shutemov > wrote: > > + page_cache_get(page); > > + spin_lock_irq(>tree_lock); > > + page->mapping = mapping; > > + page->index = offset; > > + error = radix_tree_insert(>page_tree, offset, page); > > +

Re: [PATCHv2, RFC 08/30] thp, mm: rewrite add_to_page_cache_locked() to support huge pages

2013-03-15 Thread Kirill A. Shutemov
Hillf Danton wrote: On Fri, Mar 15, 2013 at 1:50 AM, Kirill A. Shutemov kirill.shute...@linux.intel.com wrote: + page_cache_get(page); + spin_lock_irq(mapping-tree_lock); + page-mapping = mapping; + page-index = offset; + error =

Re: [PATCHv2, RFC 08/30] thp, mm: rewrite add_to_page_cache_locked() to support huge pages

2013-03-15 Thread Hillf Danton
On Fri, Mar 15, 2013 at 9:23 PM, Kirill A. Shutemov kirill.shute...@linux.intel.com wrote: Hillf Danton wrote: On Fri, Mar 15, 2013 at 1:50 AM, Kirill A. Shutemov kirill.shute...@linux.intel.com wrote: + page_cache_get(page); + spin_lock_irq(mapping-tree_lock); +

Re: [PATCHv2, RFC 08/30] thp, mm: rewrite add_to_page_cache_locked() to support huge pages

2013-03-15 Thread Kirill A. Shutemov
Hillf Danton wrote: On Fri, Mar 15, 2013 at 9:23 PM, Kirill A. Shutemov kirill.shute...@linux.intel.com wrote: Hillf Danton wrote: On Fri, Mar 15, 2013 at 1:50 AM, Kirill A. Shutemov kirill.shute...@linux.intel.com wrote: + page_cache_get(page); +

Re: [PATCHv2, RFC 08/30] thp, mm: rewrite add_to_page_cache_locked() to support huge pages

2013-03-15 Thread Hillf Danton
On Fri, Mar 15, 2013 at 9:50 PM, Kirill A. Shutemov kirill.shute...@linux.intel.com wrote: Hillf Danton wrote: On Fri, Mar 15, 2013 at 9:23 PM, Kirill A. Shutemov kirill.shute...@linux.intel.com wrote: Hillf Danton wrote: On Fri, Mar 15, 2013 at 1:50 AM, Kirill A. Shutemov

Re: [PATCHv2, RFC 08/30] thp, mm: rewrite add_to_page_cache_locked() to support huge pages

2013-03-15 Thread Kirill A. Shutemov
Hillf Danton wrote: On Fri, Mar 15, 2013 at 9:50 PM, Kirill A. Shutemov kirill.shute...@linux.intel.com wrote: Hillf Danton wrote: On Fri, Mar 15, 2013 at 9:23 PM, Kirill A. Shutemov kirill.shute...@linux.intel.com wrote: Hillf Danton wrote: On Fri, Mar 15, 2013 at 1:50 AM, Kirill A.

Re: [PATCHv2, RFC 08/30] thp, mm: rewrite add_to_page_cache_locked() to support huge pages

2013-03-14 Thread Hillf Danton
On Fri, Mar 15, 2013 at 1:50 AM, Kirill A. Shutemov wrote: > + page_cache_get(page); > + spin_lock_irq(>tree_lock); > + page->mapping = mapping; > + page->index = offset; > + error = radix_tree_insert(>page_tree, offset, page); > + if (unlikely(error)) > +

[PATCHv2, RFC 08/30] thp, mm: rewrite add_to_page_cache_locked() to support huge pages

2013-03-14 Thread Kirill A. Shutemov
From: "Kirill A. Shutemov" For huge page we add to radix tree HPAGE_CACHE_NR pages at once: head page for the specified index and HPAGE_CACHE_NR-1 tail pages for following indexes. Signed-off-by: Kirill A. Shutemov --- mm/filemap.c | 76

[PATCHv2, RFC 08/30] thp, mm: rewrite add_to_page_cache_locked() to support huge pages

2013-03-14 Thread Kirill A. Shutemov
From: Kirill A. Shutemov kirill.shute...@linux.intel.com For huge page we add to radix tree HPAGE_CACHE_NR pages at once: head page for the specified index and HPAGE_CACHE_NR-1 tail pages for following indexes. Signed-off-by: Kirill A. Shutemov kirill.shute...@linux.intel.com --- mm/filemap.c |

Re: [PATCHv2, RFC 08/30] thp, mm: rewrite add_to_page_cache_locked() to support huge pages

2013-03-14 Thread Hillf Danton
On Fri, Mar 15, 2013 at 1:50 AM, Kirill A. Shutemov kirill.shute...@linux.intel.com wrote: + page_cache_get(page); + spin_lock_irq(mapping-tree_lock); + page-mapping = mapping; + page-index = offset; + error = radix_tree_insert(mapping-page_tree, offset, page);