From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752726AbbHTOnL (ORCPT ); Thu, 20 Aug 2015 10:43:11 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:35701 "EHLO mail-wi0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751210AbbHTOnJ (ORCPT ); Thu, 20 Aug 2015 10:43:09 -0400 Date: Thu, 20 Aug 2015 16:43:06 +0200 From: Michal Hocko To: Vlastimil Babka Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mel Gorman , David Rientjes , Greg Thelen , "Aneesh Kumar K.V" , Christoph Lameter , Pekka Enberg , Joonsoo Kim , Naoya Horiguchi , Johannes Weiner , linux-ia64@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, cbe-oss-dev@lists.ozlabs.org, kvm@vger.kernel.org Subject: Re: [PATCH 2/3] mm: unify checks in alloc_pages_node() and __alloc_pages_node() Message-ID: <20150820144306.GE4632@dhcp22.suse.cz> References: <1440071002-19085-1-git-send-email-vbabka@suse.cz> <1440071002-19085-2-git-send-email-vbabka@suse.cz> <20150820141434.GD4632@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150820141434.GD4632@dhcp22.suse.cz> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 20-08-15 16:14:34, Michal Hocko wrote: > On Thu 20-08-15 13:43:21, Vlastimil Babka wrote: > > Perform the same debug checks in alloc_pages_node() as are done in > > __alloc_pages_node(), by making the former function a wrapper of the latter > > one. > > > > In addition to better diagnostics in DEBUG_VM builds for situations which > > have been already fatal (e.g. out-of-bounds node id), there are two visible > > changes for potential existing buggy callers of alloc_pages_node(): > > > > - calling alloc_pages_node() with any negative nid (e.g. due to arithmetic > > overflow) was treated as passing NUMA_NO_NODE and fallback to local node was > > applied. This will now be fatal. > > OK, this is sensible > > > - calling alloc_pages_node() with an offline node will now be checked for > > DEBUG_VM builds. Since it's not fatal if the node has been previously online, > > and this patch may expose some existing buggy callers, change the VM_BUG_ON > > in __alloc_pages_node() to VM_WARN_ON. > > Yes, bugging on just because we race with memory hotplug or use > stale node number is not appropriate because the fallback is > straightforward. A warning should help to identify and fix those place. > > > > > Signed-off-by: Vlastimil Babka > > Acked-by: David Rientjes > > Acked-by: Johannes Weiner > > Acked-by: Christoph Lameter Forgot to add Acked-by: Michal Hocko -- Michal Hocko SUSE Labs