From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx136.postini.com [74.125.245.136]) by kanga.kvack.org (Postfix) with SMTP id E5ED56B014E for ; Thu, 4 Oct 2012 16:09:37 -0400 (EDT) Received: by mail-qc0-f169.google.com with SMTP id t2so825256qcq.14 for ; Thu, 04 Oct 2012 13:09:37 -0700 (PDT) Message-ID: <506DED04.6090706@gmail.com> Date: Thu, 04 Oct 2012 16:09:40 -0400 From: KOSAKI Motohiro MIME-Version: 1.0 Subject: Re: [PATCH 29/33] autonuma: page_autonuma References: <1349308275-2174-1-git-send-email-aarcange@redhat.com> <1349308275-2174-30-git-send-email-aarcange@redhat.com> In-Reply-To: <1349308275-2174-30-git-send-email-aarcange@redhat.com> Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Andrea Arcangeli Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Linus Torvalds , Andrew Morton , Peter Zijlstra , Ingo Molnar , Mel Gorman , Hugh Dickins , Rik van Riel , Johannes Weiner , Hillf Danton , Andrew Jones , Dan Smith , Thomas Gleixner , Paul Turner , Christoph Lameter , Suresh Siddha , Mike Galbraith , "Paul E. McKenney" , Lai Jiangshan , Bharata B Rao , Lee Schermerhorn , Srivatsa Vaddagiri , Alex Shi , Mauricio Faria de Oliveira , Konrad Rzeszutek Wilk , Don Morris , Benjamin Herrenschmidt , kosaki.motohiro@gmail.com > +struct page_autonuma *lookup_page_autonuma(struct page *page) > +{ > + unsigned long pfn = page_to_pfn(page); > + unsigned long offset; > + struct page_autonuma *base; > + > + base = NODE_DATA(page_to_nid(page))->node_page_autonuma; > +#ifdef CONFIG_DEBUG_VM > + /* > + * The sanity checks the page allocator does upon freeing a > + * page can reach here before the page_autonuma arrays are > + * allocated when feeding a range of pages to the allocator > + * for the first time during bootup or memory hotplug. > + */ > + if (unlikely(!base)) > + return NULL; > +#endif When using CONFIG_DEBUG_VM, please just use BUG_ON instead of additional sanity check. Otherwise only MM people might fault to find a real bug. And I have additional question here. What's happen if memory hotplug occur and several autonuma_last_nid will point to invalid node id? My quick skimming didn't find hotplug callback code. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org