Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1436894imm; Wed, 20 Jun 2018 18:43:07 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIxKgpe/AyWJ1Dqos6BK3WEOc8+ayXlJn6tlHq0VPubAIeefObI//IgffvDq5CrV35m0U5V X-Received: by 2002:a65:4287:: with SMTP id j7-v6mr20815077pgp.144.1529545387223; Wed, 20 Jun 2018 18:43:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529545387; cv=none; d=google.com; s=arc-20160816; b=UMW7+q164fBpZD8mRf9KwAxE2RDGXkGO5hOjwqSvTTkZaOrBUylnKhpcNLHWduZHPm ke3SR76WpyOPgIvP14D0Dnc2U5j75Zt3eXzs1PIDTBycva9yVHbuyjcgYuj8ZEuHdVFt oXzTt3m+NO5gU81alayKjzr9MkYXy1Dtmx7aasYBBCgd5yjEpume+D4tR43Su8COUhjp qEdBOaJqkNXB/isHBsidkOrcBCyJFFwuG8Z0tKupFOzsUlg9yaMSCeO5853naTg70Njj 1QixfQhWb7BJbftAMhZpsIjDVcJGP8ZktTatEa47fjtEdriIUtoav15eHoEL2d5Py4Si x5tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=0O5lJHUS3FTNwACyC87ZJCucZgIv/u4qglMoLba5z5g=; b=TycCzPhpyJ2oBlvxENHVVEJ6HHOo2lcR/EPdd82ZboQao7X+YUieOCPLk2ewTXBJeK 2qib7t08WiFxDE74HHi5Opu0o0HupuwqJGgizqdrThO1rSR48HEKx2CpGUs1L/9WqVEM iHiIfn5vrNezZQLv5sb2fJHC13hpwHiIppBtOd6ldRJffCkCdHazeeasNf/vA+lKAuU5 edvONksgcaEcAJSp4oNylvUuv8IPCQKzcELY1G5NZd2n92crYPhTB+QbJO7spUeCuPxx XCMmH7k5cCMeSqKTafnLxeNmN5M2vE4M4gWUSmQJe6ad+issE1uaDIaFOj0qGc6TBtho ejqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=JkIBthJl; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u7-v6si2948748pgp.446.2018.06.20.18.42.52; Wed, 20 Jun 2018 18:43:07 -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; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=JkIBthJl; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754142AbeFUBmQ (ORCPT + 99 others); Wed, 20 Jun 2018 21:42:16 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:55202 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754079AbeFUBmP (ORCPT ); Wed, 20 Jun 2018 21:42:15 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w5L1cqv8021399 for ; Thu, 21 Jun 2018 01:42:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : references : in-reply-to : from : date : message-id : subject : to : cc : content-type; s=corp-2017-10-26; bh=0O5lJHUS3FTNwACyC87ZJCucZgIv/u4qglMoLba5z5g=; b=JkIBthJlYGHWUSA5Z43luFHsAo/CeIbLt2U+g3l8WGEGFW8DYNhw1aHIAEuu5vD+IQfp 2+a4g0n7ixfcxWmhjrdEPuot0hITsfAHt3vyGPr41MwVbWfSwc8ivYBU45Ai8jqumsTf 6YZ1FREgO2T8pkmshSQ1e67HubD4QeUB0xZoFcdKGePi7ATQ2Nl0TJHdkKZ5sDqT3sh8 NAvtj82BeLw8QTcKiXEZSb1h0uoTPmHqo/hcxappbENHmsfae0zDATuchdcvI19oPTRq foB+QB+dcqtCZiw0DBDzacsRJxWOrKWk/Jl1RuE5dbuvCbFPf+0NqRSkskq8Ea1O/Rsr Cw== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2120.oracle.com with ESMTP id 2jmtgwxt2e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 21 Jun 2018 01:42:14 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w5L1gCHO009978 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 21 Jun 2018 01:42:13 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w5L1gCFp011919 for ; Thu, 21 Jun 2018 01:42:12 GMT Received: from mail-ot0-f170.google.com (/74.125.82.170) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 20 Jun 2018 18:42:12 -0700 Received: by mail-ot0-f170.google.com with SMTP id q17-v6so1737563otg.2 for ; Wed, 20 Jun 2018 18:42:12 -0700 (PDT) X-Gm-Message-State: APt69E2iUqKeUehaTZc+kJ2Vsv6PoVwE/3SW+FgcYfOd40mcO4m2sW6y 4Lg5AVZEkLI+gG3lAr2IcTxOWTu+lQPfTEFau6M= X-Received: by 2002:a9d:4305:: with SMTP id s5-v6mr13491985ote.11.1529545331760; Wed, 20 Jun 2018 18:42:11 -0700 (PDT) MIME-Version: 1.0 References: <20180601125321.30652-1-osalvador@techadventures.net> <20180601125321.30652-2-osalvador@techadventures.net> <20180620151819.3f39226998bd80f7161fcea5@linux-foundation.org> In-Reply-To: <20180620151819.3f39226998bd80f7161fcea5@linux-foundation.org> From: Pavel Tatashin Date: Wed, 20 Jun 2018 21:41:35 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/4] mm/memory_hotplug: Make add_memory_resource use __try_online_node To: Andrew Morton Cc: osalvador@techadventures.net, Michal Hocko , Vlastimil Babka , Linux Memory Management List , LKML , osalvador@suse.de Content-Type: text/plain; charset="UTF-8" X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8930 signatures=668702 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=894 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1806210016 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 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 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; > > > > > > ... > > >