From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753330Ab2IMGed (ORCPT ); Thu, 13 Sep 2012 02:34:33 -0400 Received: from mail-iy0-f174.google.com ([209.85.210.174]:49108 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750779Ab2IMGe3 (ORCPT ); Thu, 13 Sep 2012 02:34:29 -0400 Date: Wed, 12 Sep 2012 23:33:47 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Xiao Guangrong cc: Andrew Morton , Andrea Arcangeli , Michel Lespinasse , David Rientjes , LKML , Linux Memory Management List Subject: Re: [PATCH 09/12] thp: introduce khugepaged_prealloc_page and khugepaged_alloc_page In-Reply-To: Message-ID: References: <5028E12C.70101@linux.vnet.ibm.com> <5028E20C.3080607@linux.vnet.ibm.com> <50500360.5020700@linux.vnet.ibm.com> User-Agent: Alpine 2.00 (LSU 1167 2008-08-23) 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 Wed, 12 Sep 2012, Hugh Dickins wrote: > > @@ -1825,6 +1825,7 @@ static bool khugepaged_prealloc_page(struct page **hpage, bool *wait) > > return false; > > > > *wait = false; > > + *hpage = NULL; > > khugepaged_alloc_sleep(); > > } else if (*hpage) { > > put_page(*hpage); > > The unshown line just below this is > > *hpage = NULL; > > I do wish you would take the "*hpage = NULL;" out of if and else blocks > and place it once below both. Hold on, I'm being unreasonable: that's an "else if", and I've no good reason to request you to set *hpage = NULL when it's already NULL. It would be okay if you did, but there's no reason for me to prefer it. Hugh