Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1691690imm; Thu, 21 Jun 2018 00:34:32 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI77B6ol4VdUifl107XwSnPG6FUTn/05jimwz4o5tanz5hKHAK2DnahVHqGyk7/3d1opUn3 X-Received: by 2002:a63:7c55:: with SMTP id l21-v6mr21937548pgn.352.1529566472024; Thu, 21 Jun 2018 00:34:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529566471; cv=none; d=google.com; s=arc-20160816; b=0UhEWkznvGQ2dwwWTOmFp0xludILxh5YXcZDy9kl3GdH/NHiMLr44he1BEKOUDrYEB N0w37bK+0bTpGdiTH2UWWwNN3dKRQjSnbPsKhmu2jD0ehBU3LlyYQI2Si5pXpPFxU+9P XYQyrhht6ch/6EMtdQ0iCJl9AlwjAtNc6K9H/ysg5Za0ieGT1r8eIZ9kprVWf4Fz8y9A 3hssHdWhFVc4mDr6ALbFbrcYrm9mffX0v1rsvzMXQkys1Mqu0n4JtKCcG4jASq9FlX0V AxEh6viy6PtMTGcZ3H8ic49xniMJBZg6jmf68DAMTL0DV7eASDxJ+eXJnQqutbkTlDM3 HnJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=tgzv4dn2xzs2jO6Ym1jqErwLPovKyBxVvzxa74qL+ck=; b=ICY5fOZmJLK7b0RS+jjjlG04NDyCfWzfu5SmYBiKkS9u/Q0Q4lj4Uart37BVssbK7v oeJKamyRykUbpNeyiGZl2LCY9i/sAilAdp2op0KpTw7n3MWF9GhN0oifma5yj1IKPJ2E diFe1SYsUpo95esB5UOlTZoV0xW/fbJ9FAYDuy8JTRJmv39RI307jXMD7pzrTDU8Nwki HU2B/3nhg59jn433QTFTx6IUgIrsVDwURCYHcU5MArNwbT2otuk12S/dAuDMyz4LzUBc 0ki2UMeFOcYalzrWRo6ATKEgK1U+jE8Hu12091hZVmRgAOUJjygojD8b9x86wCT3wBuj EURQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k91-v6si4155743pld.248.2018.06.21.00.34.17; Thu, 21 Jun 2018 00:34:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754172AbeFUHdi (ORCPT + 99 others); Thu, 21 Jun 2018 03:33:38 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:41564 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751022AbeFUHdg (ORCPT ); Thu, 21 Jun 2018 03:33:36 -0400 Received: by mail-wr0-f193.google.com with SMTP id h10-v6so2004699wrq.8 for ; Thu, 21 Jun 2018 00:33:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=tgzv4dn2xzs2jO6Ym1jqErwLPovKyBxVvzxa74qL+ck=; b=jxLYS0u7kQ1q43zPQ/9Zo/UdKdi33s+24S2q72mKEodLLq76v/4wPXIUBfEXPUpQKF FOM3W4J3vRlxCNWqQAp1PPOdLGsnIg2dmL1zON16raS/+NI4CAvGWReeH4QqZbBrxwfA cQCbs2QvaPldoMabqaITWRAiZHS6IfPOhe0vCHoFdgcdN7id5pCC+4TJUO9d5iQRYT9o SxCs5dieIiJUQvjkNTsZoG4dg5phs6JFsnba6wlBIprhFB38B/CEZ8srPBMVroVIwVeo FzCnipX/VcxADTR+RHAQwUzz2XC8osI49jV++d9yWerK2pNmHJJH1+xicjW7Xo0mRxoh ofyg== X-Gm-Message-State: APt69E0uaUX+MiXBVZFfrB83HUAIc2BkEltUlvnOpPjVyCDkDDOKtDLP k2zKY3iNwtaFLd5CQXnJ/0A= X-Received: by 2002:adf:a6b8:: with SMTP id t53-v6mr21819421wrc.45.1529566415826; Thu, 21 Jun 2018 00:33:35 -0700 (PDT) Received: from techadventures.net (techadventures.net. [62.201.165.239]) by smtp.gmail.com with ESMTPSA id v10-v6sm5559477wrn.97.2018.06.21.00.33.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Jun 2018 00:33:35 -0700 (PDT) Received: by techadventures.net (Postfix, from userid 1000) id 70FA11236FF; Thu, 21 Jun 2018 09:33:34 +0200 (CEST) Date: Thu, 21 Jun 2018 09:33:34 +0200 From: Oscar Salvador To: Pavel Tatashin Cc: Andrew Morton , Michal Hocko , Vlastimil Babka , Linux Memory Management List , LKML , osalvador@suse.de Subject: Re: [PATCH 1/4] mm/memory_hotplug: Make add_memory_resource use __try_online_node Message-ID: <20180621073334.GA11407@techadventures.net> References: <20180601125321.30652-1-osalvador@techadventures.net> <20180601125321.30652-2-osalvador@techadventures.net> <20180620151819.3f39226998bd80f7161fcea5@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 20, 2018 at 09:41:35PM -0400, Pavel Tatashin wrote: > > I don't think __try_online_node() will ever return a value greater than > > zero. I assume what was meant was > > Hi Andrew and Oscar, > > Actually, the new __try_online_node() returns: > 1 -> a new node was allocated > 0 -> node is already online > -error -> an error encountered. > > The function simply missing the return comment at the beginning. > > Oscar, please check it via ./scripts/checkpatch.pl > > Add comment explaining the return values. > > And change: > ret = __try_online_node (nid, start, false); > new_node = !!(ret > 0); > if (ret < 0) > goto error; > To: > ret = __try_online_node (nid, start, false); > if (ret < 0) > goto error; > new_node = ret; > > Other than that the patch looks good to me, it simplifies the code. > So, if the above is addressed: > > Reviewed-by: Pavel Tatashin Hi Pavel, I'll do so, thanks! > > Thank you, > Pavel > > > > > new_node = !!(ret >= 0); > > > > which may as well be > > > > new_node = (ret >= 0); > > > > since both sides have bool type. > > > > The fact that testing didn't detect this is worrisome.... > > > > > + if (ret < 0) > > > + goto error; > > > + > > > > > > /* call arch's memory hotadd */ > > > ret = arch_add_memory(nid, start, size, NULL, true); > > > - > > > if (ret < 0) > > > goto error; > > > > > > > > > ... > > > > > > -- Oscar Salvador SUSE L3