From patchwork Fri Sep 21 13:26:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oscar Salvador X-Patchwork-Id: 10610029 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CBEAB112B for ; Fri, 21 Sep 2018 13:26:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB8D62DB18 for ; Fri, 21 Sep 2018 13:26:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AF27B2DB1A; Fri, 21 Sep 2018 13:26:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9968E2DB18 for ; Fri, 21 Sep 2018 13:26:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D0F868E0003; Fri, 21 Sep 2018 09:26:44 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id C95668E0001; Fri, 21 Sep 2018 09:26:44 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B61978E0003; Fri, 21 Sep 2018 09:26:44 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by kanga.kvack.org (Postfix) with ESMTP id 53F138E0001 for ; Fri, 21 Sep 2018 09:26:44 -0400 (EDT) Received: by mail-wm1-f69.google.com with SMTP id v1-v6so2457655wmh.4 for ; Fri, 21 Sep 2018 06:26:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=0+jHGq6Iwq96rM0u3yCt0rOallYZv8FDz6OCFetpq3Y=; b=PxOxFdwTCFUGFt9XySKsBRrkYl3G/z2eTxq87Lq+d/WVlJWMvLOE7D5cE/eapmOMwn Y0TtoIVHLbetxdTBCBJZK8GWauwFy1/36dYCDo4l173rtZwEMvNhqDiXJ9FWJyLHKBgo DnHA8LDj768jtzLNccqjd6Eb03ZrWg9OmxI2W1M2KsU5b4K6ah/V6l2u8CUALTRwCzgS Pd4Tg0ZTMIJsBvsG3dkuJb7AlqAMQYkjNDVlrT+lVMOucFcYFAQUaCXciop83e48vY6b grTzvagoWjJ+lyYovg6exqT9/CXDU235IRlT7nC0Odu0bwfIrAWRyUIfuMcWKUX+jB8L KzcQ== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of osalvador.vilardaga@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=osalvador.vilardaga@gmail.com X-Gm-Message-State: APzg51CI+nO0LuZ3p/3CFEk5BMXn/I/vIo4VAa5uFUXvra9bL3UdfIxw puG/hBNX1zQrfypqyWwTK5K03sgnrBjoi2aXAs7x/sR8WhIzMSLTiDB2/tJukM1RfPBGWc9sKEo lZypFxfgUb2B1ITkDB6056/9jIHXNViKpi1ST+LjCSpEyeGmYUzIJ1w0gHMeVRZfFEfLq3yhQd7 FMRRgAItI29gD6zZFlkZ6zTV7sBgwLwANZP/r6I4d3ElNvoL7DM5d+pRSqT8SkNH9ASpRWhfYAI RHAcvaI9alxDsGz43lawZjy9e6oycfayheCJErh2b4dOJuAtCmlF+xRs8lNQsv7Jc/LMqyg8wPj G+Pi5LGUp6OE4UZfcZUMNCSSWQ0VpfNMvwXt1HfDmKs79diUcNRWw098UkuQeXTjkQi58fpu2g= = X-Received: by 2002:adf:b3d7:: with SMTP id x23-v6mr36978907wrd.253.1537536403822; Fri, 21 Sep 2018 06:26:43 -0700 (PDT) X-Received: by 2002:adf:b3d7:: with SMTP id x23-v6mr36978837wrd.253.1537536402831; Fri, 21 Sep 2018 06:26:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537536402; cv=none; d=google.com; s=arc-20160816; b=qpJghbPKJsmPMT9AHi36324K+aFuEqWynqS/mzHqqRT6G8cRbqS8XqMkw5o8JidKFa kE2OuzvSszV9KTpxzaW6k4nMWwiRQiY7FAsE4SzRZVRf45Ao1Or9QNQTSTROh3JqIMyE /k86Tkw367YLkUrbIryIwwQ59t40SHRFNp0kj/IhLJrkToZy8bfiaaF2tVufDMCVkRkx WVG8F+iOiIEucNrkRK9RZJjO9IUwBktfLexT+N4iCoY7rjqQuEawi4CTv3mZ9g/HkNLn /mKjiq/OXeRYdgw58dTQSjUMYRwDfIV2d65GO4de3oLcpk/skWVLmZBlWzNcaIdn6DMH Nkjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=0+jHGq6Iwq96rM0u3yCt0rOallYZv8FDz6OCFetpq3Y=; b=DnxueFUiAL6ZfSfiuNsRPZYsrpU+Uq3TyfORHet7n+uv/bmPN9t1Nz/QWWjwGz7pf7 g3rv4NaUsaBRC97akK8aiTQxDkMSU0mIkZ+g98Jb23JQrMOMf3QhEvakN2ayjoXh0GWR 2BzB+BKe6z0rjf3y6lgaY900cXSXuUUi+YtTcSfJWndwlr4W1yLYaoywl4oaG441Jo+o u7YE/ybNHrXD5DNkIRhUfG12kNklZSevslXp7SIgZeNppaBaSYFFSZOFayDxu8aKkmKa 6AmA3ZtWTmNuZqV+uB5hVZ12T/TZiZmmFy+RCZfIETru68D5eS8sRcFWCCLZrSU25SVy 6Vsg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of osalvador.vilardaga@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=osalvador.vilardaga@gmail.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id o6-v6sor4220764wmg.12.2018.09.21.06.26.42 for (Google Transport Security); Fri, 21 Sep 2018 06:26:42 -0700 (PDT) Received-SPF: pass (google.com: domain of osalvador.vilardaga@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; spf=pass (google.com: domain of osalvador.vilardaga@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=osalvador.vilardaga@gmail.com X-Google-Smtp-Source: ACcGV63VnEIdtWdmykAmtjohRoKq43GYZCAWnbD21lKsgOQ0NIOfDFUJEGrdmBu11s3W5JMpAc74/Q== X-Received: by 2002:a1c:148f:: with SMTP id 137-v6mr7024221wmu.61.1537536402509; Fri, 21 Sep 2018 06:26:42 -0700 (PDT) Received: from techadventures.net (techadventures.net. [62.201.165.239]) by smtp.gmail.com with ESMTPSA id x204-v6sm5567205wmg.27.2018.09.21.06.26.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Sep 2018 06:26:41 -0700 (PDT) Received: from d104.suse.de (nat.nue.novell.com [195.135.221.2]) by techadventures.net (Postfix) with ESMTPA id 4F88D125334; Fri, 21 Sep 2018 15:26:40 +0200 (CEST) From: Oscar Salvador To: akpm@linux-foundation.org Cc: mhocko@suse.com, dan.j.williams@intel.com, david@redhat.com, Pavel.Tatashin@microsoft.com, Jonathan.Cameron@huawei.com, yasu.isimatu@gmail.com, malat@debian.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Oscar Salvador Subject: [PATCH v2 2/4] mm/memory_hotplug: Tidy up node_states_clear_node Date: Fri, 21 Sep 2018 15:26:32 +0200 Message-Id: <20180921132634.10103-3-osalvador@techadventures.net> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180921132634.10103-1-osalvador@techadventures.net> References: <20180921132634.10103-1-osalvador@techadventures.net> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP From: Oscar Salvador node_states_clear has the following if statements: if ((N_MEMORY != N_NORMAL_MEMORY) && (arg->status_change_nid_high >= 0)) ... if ((N_MEMORY != N_HIGH_MEMORY) && (arg->status_change_nid >= 0)) ... N_MEMORY can never be equal to neither N_NORMAL_MEMORY nor N_HIGH_MEMORY. Similar problem was found in [1]. Since this is wrong, let us get rid of it. [1] https://patchwork.kernel.org/patch/10579155/ Signed-off-by: Oscar Salvador Reviewed-by: Pavel Tatashin --- mm/memory_hotplug.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 63facfc57224..561c44761f95 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1582,12 +1582,10 @@ static void node_states_clear_node(int node, struct memory_notify *arg) if (arg->status_change_nid_normal >= 0) node_clear_state(node, N_NORMAL_MEMORY); - if ((N_MEMORY != N_NORMAL_MEMORY) && - (arg->status_change_nid_high >= 0)) + if (arg->status_change_nid_high >= 0) node_clear_state(node, N_HIGH_MEMORY); - if ((N_MEMORY != N_HIGH_MEMORY) && - (arg->status_change_nid >= 0)) + if (arg->status_change_nid >= 0) node_clear_state(node, N_MEMORY); }