From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753457AbcALWkY (ORCPT ); Tue, 12 Jan 2016 17:40:24 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:39309 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752009AbcALWkV (ORCPT ); Tue, 12 Jan 2016 17:40:21 -0500 Date: Tue, 12 Jan 2016 14:40:20 -0800 From: Andrew Morton To: nimisolo Cc: kuleshovmail@gmail.com, penberg@kernel.org, tony.luck@intel.com, mgorman@suse.de, tangchen@cn.fujitsu.com, weiyang@linux.vnet.ibm.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/memblock: If nr_new is 0 just return Message-Id: <20160112144020.db1cd77e97e41d5c48024c3c@linux-foundation.org> In-Reply-To: <1452339220-3457-1-git-send-email-nimisolo@gmail.com> References: <1452339220-3457-1-git-send-email-nimisolo@gmail.com> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 9 Jan 2016 06:33:40 -0500 nimisolo wrote: > If nr_new is 0 which means there's no region would be added, > so just return to the caller. > > ... > > --- a/mm/memblock.c > +++ b/mm/memblock.c > @@ -588,6 +588,9 @@ repeat: > nid, flags); > } > > + if (!nr_new) > + return 0; > + > /* > * If this was the first round, resize array and repeat for actual > * insertions; otherwise, merge and return. hm, why? Is there something actually wrong with the current code? Under what circumstances does nr_new==0 actually happen? Is it a bug in the caller?