Re: [PATCHv2, RFC 13/30] thp, mm: implement grab_cache_huge_page_write_begin()

2013-03-26 Thread Dave
On 03/26/2013 03:48 AM, Kirill A. Shutemov wrote: > Dave Hansen wrote: >>> +repeat: >>> + page = find_lock_page(mapping, index); >>> + if (page) { >>> + if (!PageTransHuge(page)) { >>> + unlock_page(page); >>> + page_cache_release(page); >>> +

Re: [PATCHv2, RFC 13/30] thp, mm: implement grab_cache_huge_page_write_begin()

2013-03-26 Thread Kirill A. Shutemov
Dave Hansen wrote: > > +repeat: > > + page = find_lock_page(mapping, index); > > + if (page) { > > + if (!PageTransHuge(page)) { > > + unlock_page(page); > > + page_cache_release(page); > > + return NULL; > > + } > > +

Re: [PATCHv2, RFC 13/30] thp, mm: implement grab_cache_huge_page_write_begin()

2013-03-26 Thread Kirill A. Shutemov
Dave Hansen wrote: +repeat: + page = find_lock_page(mapping, index); + if (page) { + if (!PageTransHuge(page)) { + unlock_page(page); + page_cache_release(page); + return NULL; + } + goto

Re: [PATCHv2, RFC 13/30] thp, mm: implement grab_cache_huge_page_write_begin()

2013-03-26 Thread Dave
On 03/26/2013 03:48 AM, Kirill A. Shutemov wrote: Dave Hansen wrote: +repeat: + page = find_lock_page(mapping, index); + if (page) { + if (!PageTransHuge(page)) { + unlock_page(page); + page_cache_release(page); + return

Re: [PATCHv2, RFC 13/30] thp, mm: implement grab_cache_huge_page_write_begin()

2013-03-21 Thread Dave Hansen
On 03/14/2013 10:50 AM, Kirill A. Shutemov wrote: > +found: > + wait_on_page_writeback(page); > + return page; > +} > +#endif In grab_cache_page_write_begin(), this "wait" is: wait_for_stable_page(page); Why is it different here? -- To unsubscribe from this list: send the line

Re: [PATCHv2, RFC 13/30] thp, mm: implement grab_cache_huge_page_write_begin()

2013-03-21 Thread Dave Hansen
On 03/14/2013 10:50 AM, Kirill A. Shutemov wrote: > From: "Kirill A. Shutemov" > > The function is grab_cache_page_write_begin() twin but it tries to > allocate huge page at given position aligned to HPAGE_CACHE_NR. The obvious question, then, is whether we should just replace

Re: [PATCHv2, RFC 13/30] thp, mm: implement grab_cache_huge_page_write_begin()

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 The function is grab_cache_page_write_begin() twin but it tries to allocate huge page at given position aligned to HPAGE_CACHE_NR. The obvious question, then, is whether we should just

Re: [PATCHv2, RFC 13/30] thp, mm: implement grab_cache_huge_page_write_begin()

2013-03-21 Thread Dave Hansen
On 03/14/2013 10:50 AM, Kirill A. Shutemov wrote: +found: + wait_on_page_writeback(page); + return page; +} +#endif In grab_cache_page_write_begin(), this wait is: wait_for_stable_page(page); Why is it different here? -- To unsubscribe from this list: send the line

Re: [PATCHv2, RFC 13/30] thp, mm: implement grab_cache_huge_page_write_begin()

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

Re: [PATCHv2, RFC 13/30] thp, mm: implement grab_cache_huge_page_write_begin()

2013-03-15 Thread Kirill A. Shutemov
Hillf Danton wrote: > On Fri, Mar 15, 2013 at 9:24 PM, Kirill A. Shutemov > wrote: > > Hillf Danton wrote: > >> On Fri, Mar 15, 2013 at 1:50 AM, Kirill A. Shutemov > >> wrote: > >> > +#ifdef CONFIG_TRANSPARENT_HUGEPAGE > >> > +struct page *grab_cache_huge_page_write_begin(struct address_space >

Re: [PATCHv2, RFC 13/30] thp, mm: implement grab_cache_huge_page_write_begin()

2013-03-15 Thread Hillf Danton
On Fri, Mar 15, 2013 at 9:24 PM, Kirill A. Shutemov wrote: > Hillf Danton wrote: >> On Fri, Mar 15, 2013 at 1:50 AM, Kirill A. Shutemov >> wrote: >> > +#ifdef CONFIG_TRANSPARENT_HUGEPAGE >> > +struct page *grab_cache_huge_page_write_begin(struct address_space >> > *mapping, >> > +

Re: [PATCHv2, RFC 13/30] thp, mm: implement grab_cache_huge_page_write_begin()

2013-03-15 Thread Kirill A. Shutemov
Hillf Danton wrote: > On Fri, Mar 15, 2013 at 1:50 AM, Kirill A. Shutemov > wrote: > > +#ifdef CONFIG_TRANSPARENT_HUGEPAGE > > +struct page *grab_cache_huge_page_write_begin(struct address_space > > *mapping, > > + pgoff_t index, unsigned flags); > > +#else > > +static

Re: [PATCHv2, RFC 13/30] thp, mm: implement grab_cache_huge_page_write_begin()

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: +#ifdef CONFIG_TRANSPARENT_HUGEPAGE +struct page *grab_cache_huge_page_write_begin(struct address_space *mapping, + pgoff_t index, unsigned flags);

Re: [PATCHv2, RFC 13/30] thp, mm: implement grab_cache_huge_page_write_begin()

2013-03-15 Thread Hillf Danton
On Fri, Mar 15, 2013 at 9:24 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: +#ifdef CONFIG_TRANSPARENT_HUGEPAGE +struct page *grab_cache_huge_page_write_begin(struct

Re: [PATCHv2, RFC 13/30] thp, mm: implement grab_cache_huge_page_write_begin()

2013-03-15 Thread Kirill A. Shutemov
Hillf Danton wrote: On Fri, Mar 15, 2013 at 9:24 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: +#ifdef CONFIG_TRANSPARENT_HUGEPAGE +struct page

Re: [PATCHv2, RFC 13/30] thp, mm: implement grab_cache_huge_page_write_begin()

2013-03-15 Thread Hillf Danton
On Fri, Mar 15, 2013 at 9:35 PM, Kirill A. Shutemov kirill.shute...@linux.intel.com wrote: Hillf Danton wrote: On Fri, Mar 15, 2013 at 9:24 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 13/30] thp, mm: implement grab_cache_huge_page_write_begin()

2013-03-14 Thread Hillf Danton
On Fri, Mar 15, 2013 at 1:50 AM, Kirill A. Shutemov wrote: > +#ifdef CONFIG_TRANSPARENT_HUGEPAGE > +struct page *grab_cache_huge_page_write_begin(struct address_space *mapping, > + pgoff_t index, unsigned flags); > +#else > +static inline struct page

[PATCHv2, RFC 13/30] thp, mm: implement grab_cache_huge_page_write_begin()

2013-03-14 Thread Kirill A. Shutemov
From: "Kirill A. Shutemov" The function is grab_cache_page_write_begin() twin but it tries to allocate huge page at given position aligned to HPAGE_CACHE_NR. If, for some reason, it's not possible allocate a huge page at this possition, it returns NULL. Caller should take care of fallback to

[PATCHv2, RFC 13/30] thp, mm: implement grab_cache_huge_page_write_begin()

2013-03-14 Thread Kirill A. Shutemov
From: Kirill A. Shutemov kirill.shute...@linux.intel.com The function is grab_cache_page_write_begin() twin but it tries to allocate huge page at given position aligned to HPAGE_CACHE_NR. If, for some reason, it's not possible allocate a huge page at this possition, it returns NULL. Caller

Re: [PATCHv2, RFC 13/30] thp, mm: implement grab_cache_huge_page_write_begin()

2013-03-14 Thread Hillf Danton
On Fri, Mar 15, 2013 at 1:50 AM, Kirill A. Shutemov kirill.shute...@linux.intel.com wrote: +#ifdef CONFIG_TRANSPARENT_HUGEPAGE +struct page *grab_cache_huge_page_write_begin(struct address_space *mapping, + pgoff_t index, unsigned flags); +#else +static inline struct