From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Wed, 15 Oct 2014 23:05:01 +0300 From: "Kirill A. Shutemov" To: Andrew Morton Cc: Yu Zhao , "Kirill A. Shutemov" , Mel Gorman , Rik van Riel , Ingo Molnar , Hugh Dickins , Sasha Levin , Bob Liu , Johannes Weiner , David Rientjes , Vlastimil Babka , linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v2 1/2] mm: free compound page with correct order Message-ID: <20141015200501.GA17066@node.dhcp.inet.fi> References: <1413400805-15547-1-git-send-email-yuzhao@google.com> <20141015123044.03f38a520b01c5d332e3d9a5@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141015123044.03f38a520b01c5d332e3d9a5@linux-foundation.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: On Wed, Oct 15, 2014 at 12:30:44PM -0700, Andrew Morton wrote: > > @@ -232,7 +232,7 @@ static unsigned long shrink_huge_zero_page_scan(struct shrinker *shrink, > > if (atomic_cmpxchg(&huge_zero_refcount, 1, 0) == 1) { > > struct page *zero_page = xchg(&huge_zero_page, NULL); > > BUG_ON(zero_page == NULL); > > - __free_page(zero_page); > > + __free_pages(zero_page, compound_order(zero_page)); > > But I'm surprised that this is also rare. It makes me wonder if this > code is working correctly. This should be rare too. To get here we need a situation when huge zero page is allocated, but not mapped and we get memory presure to trigger shrinker. -- Kirill A. Shutemov