[PATCH v3 10/10] thp: implement refcounting for huge zero page

2012-10-02 Thread Kirill A. Shutemov
From: "Kirill A. Shutemov" H. Peter Anvin doesn't like huge zero page which sticks in memory forever after the first allocation. Here's implementation of lockless refcounting for huge zero page. We have two basic primitives: {get,put}_huge_zero_page(). They manipulate reference counter. If coun

Re: [PATCH v3 10/10] thp: implement refcounting for huge zero page

2012-09-13 Thread Andrea Arcangeli
Hi Kirill, On Thu, Sep 13, 2012 at 08:37:58PM +0300, Kirill A. Shutemov wrote: > On Thu, Sep 13, 2012 at 07:16:13PM +0200, Andrea Arcangeli wrote: > > Hi Kirill, > > > > On Wed, Sep 12, 2012 at 01:07:53PM +0300, Kirill A. Shutemov wrote: > > > - hpage = alloc_pages(GFP_TRANSHUGE | __GFP_ZERO, HPA

Re: [PATCH v3 10/10] thp: implement refcounting for huge zero page

2012-09-13 Thread Kirill A. Shutemov
On Thu, Sep 13, 2012 at 07:16:13PM +0200, Andrea Arcangeli wrote: > Hi Kirill, > > On Wed, Sep 12, 2012 at 01:07:53PM +0300, Kirill A. Shutemov wrote: > > - hpage = alloc_pages(GFP_TRANSHUGE | __GFP_ZERO, HPAGE_PMD_ORDER); > > The page is likely as large as a pageblock so it's unlikely to creat

Re: [PATCH v3 10/10] thp: implement refcounting for huge zero page

2012-09-13 Thread Andrea Arcangeli
Hi Kirill, On Wed, Sep 12, 2012 at 01:07:53PM +0300, Kirill A. Shutemov wrote: > - hpage = alloc_pages(GFP_TRANSHUGE | __GFP_ZERO, HPAGE_PMD_ORDER); The page is likely as large as a pageblock so it's unlikely to create much fragmentation even if the __GFP_MOVABLE is set. Said that I guess it

[PATCH v3 10/10] thp: implement refcounting for huge zero page

2012-09-12 Thread Kirill A. Shutemov
From: "Kirill A. Shutemov" H. Peter Anvin doesn't like huge zero page which sticks in memory forever after the first allocation. Here's implementation of lockless refcounting for huge zero page. We have two basic primitives: {get,put}_huge_zero_page(). They manipulate reference counter. If coun