Re: [PATCHv3 14/24] thp: implement new split_huge_page()

2015-02-16 Thread Kirill A. Shutemov
On Thu, Feb 12, 2015 at 02:24:40PM -0500, Sasha Levin wrote: > On 02/12/2015 12:07 PM, Sasha Levin wrote: > > On 02/12/2015 11:18 AM, Kirill A. Shutemov wrote: > >> > +void __get_page_tail(struct page *page); > >> > static inline void get_page(struct page *page) > >> > { > >> > -struct

Re: [PATCHv3 14/24] thp: implement new split_huge_page()

2015-02-16 Thread Kirill A. Shutemov
On Thu, Feb 12, 2015 at 02:24:40PM -0500, Sasha Levin wrote: On 02/12/2015 12:07 PM, Sasha Levin wrote: On 02/12/2015 11:18 AM, Kirill A. Shutemov wrote: +void __get_page_tail(struct page *page); static inline void get_page(struct page *page) { -struct page *page_head =

Re: [PATCHv3 14/24] thp: implement new split_huge_page()

2015-02-12 Thread Sasha Levin
On 02/12/2015 12:07 PM, Sasha Levin wrote: > On 02/12/2015 11:18 AM, Kirill A. Shutemov wrote: >> > +void __get_page_tail(struct page *page); >> > static inline void get_page(struct page *page) >> > { >> > - struct page *page_head = compound_head(page); >> > -

Re: [PATCHv3 14/24] thp: implement new split_huge_page()

2015-02-12 Thread Sasha Levin
On 02/12/2015 11:18 AM, Kirill A. Shutemov wrote: > +void __get_page_tail(struct page *page); > static inline void get_page(struct page *page) > { > - struct page *page_head = compound_head(page); > - VM_BUG_ON_PAGE(atomic_read(_head->_count) <= 0, page); > -

[PATCHv3 14/24] thp: implement new split_huge_page()

2015-02-12 Thread Kirill A. Shutemov
The new split_huge_page() can fail if the compound is pinned: we expect only caller to have one reference to head page. If the page is pinned split_huge_page() returns -EBUSY and caller must handle this correctly. We don't need mark PMDs splitting since now we can split one PMD a time with

Re: [PATCHv3 14/24] thp: implement new split_huge_page()

2015-02-12 Thread Sasha Levin
On 02/12/2015 12:07 PM, Sasha Levin wrote: On 02/12/2015 11:18 AM, Kirill A. Shutemov wrote: +void __get_page_tail(struct page *page); static inline void get_page(struct page *page) { - struct page *page_head = compound_head(page); - VM_BUG_ON_PAGE(atomic_read(page_head-_count) = 0,

[PATCHv3 14/24] thp: implement new split_huge_page()

2015-02-12 Thread Kirill A. Shutemov
The new split_huge_page() can fail if the compound is pinned: we expect only caller to have one reference to head page. If the page is pinned split_huge_page() returns -EBUSY and caller must handle this correctly. We don't need mark PMDs splitting since now we can split one PMD a time with

Re: [PATCHv3 14/24] thp: implement new split_huge_page()

2015-02-12 Thread Sasha Levin
On 02/12/2015 11:18 AM, Kirill A. Shutemov wrote: +void __get_page_tail(struct page *page); static inline void get_page(struct page *page) { - struct page *page_head = compound_head(page); - VM_BUG_ON_PAGE(atomic_read(page_head-_count) = 0, page); -