From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932629AbcFBTsJ (ORCPT ); Thu, 2 Jun 2016 15:48:09 -0400 Received: from mail-pf0-f182.google.com ([209.85.192.182]:35010 "EHLO mail-pf0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751326AbcFBTsH (ORCPT ); Thu, 2 Jun 2016 15:48:07 -0400 Date: Thu, 2 Jun 2016 12:47:57 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: "Kirill A. Shutemov" cc: Gerald Schaefer , "Kirill A. Shutemov" , Andrea Arcangeli , "Aneesh Kumar K.V" , Mel Gorman , Hugh Dickins , Johannes Weiner , Dave Hansen , Vlastimil Babka , Andrew Morton , Linus Torvalds , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Christian Borntraeger , Martin Schwidefsky , Heiko Carstens Subject: Re: [BUG/REGRESSION] THP: broken page count after commit aa88b68c In-Reply-To: <20160602155149.GB8493@node.shutemov.name> Message-ID: References: <20160602172141.75c006a9@thinkpad> <20160602155149.GB8493@node.shutemov.name> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2 Jun 2016, Kirill A. Shutemov wrote: > On Thu, Jun 02, 2016 at 05:21:41PM +0200, Gerald Schaefer wrote: > > > > The following quick hack fixed the issue: > > > > diff --git a/mm/swap_state.c b/mm/swap_state.c > > index 0d457e7..c99463a 100644 > > --- a/mm/swap_state.c > > +++ b/mm/swap_state.c > > @@ -252,7 +252,10 @@ static inline void free_swap_cache(struct page *page) > > void free_page_and_swap_cache(struct page *page) > > { > > free_swap_cache(page); > > - put_page(page); > > + if (is_huge_zero_page(page)) > > + put_huge_zero_page(); > > + else > > + put_page(page); > > } > > > > /* > > The fix looks good to me. Is there a good reason why the refcount of the huge_zero_page is huge_zero_refcount, instead of the refcount of the huge_zero_page? Wouldn't the latter avoid such is_huge_zero_page() special-casing? Hugh