From patchwork Wed Sep 19 10:08:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oscar Salvador X-Patchwork-Id: 10605583 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 BF48F161F for ; Wed, 19 Sep 2018 10:08:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B33212B59D for ; Wed, 19 Sep 2018 10:08:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A7C312B5F2; Wed, 19 Sep 2018 10:08:49 +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 480A52B59D for ; Wed, 19 Sep 2018 10:08:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8F2CB8E0008; Wed, 19 Sep 2018 06:08:42 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 852B58E0001; Wed, 19 Sep 2018 06:08:42 -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 683848E0008; Wed, 19 Sep 2018 06:08:42 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by kanga.kvack.org (Postfix) with ESMTP id ED8658E0001 for ; Wed, 19 Sep 2018 06:08:41 -0400 (EDT) Received: by mail-wr1-f71.google.com with SMTP id g3-v6so2826643wrr.11 for ; Wed, 19 Sep 2018 03:08:41 -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=nPK6uXZN7cckrZujWIB4/aDojr48F0Bx+xBF9fcQrF4=; b=m2FB9o/aBPjOrlHwij7tSjbnX3FAjJAM4biR88lE/no+d/aZ86SdsuLPPRmSFGKmNH SPUOg7F3kS7cXADXWHhPSm2iw9XWszmq9Qe5GjQ3KLIlkD9McJYf5D2lWFuitTTiypJg 7DxAmI4cwyY+EZml6MqmUD+CNh5vt0K+WS+gkrjMUce6Awoh+45jvqoWAf8RQQNC62Hr GXSRklNK4kaYLo5G9GiwC7EnIoD9LOT8mY4rrYiDi4DzrzNaOu01AXbNZBOuKjk1hp1U IJ6OMbhN3ePJ6bXwQUVNq4cix84DS0TqLt23ofpoDmcbaj87K7zEa2zNMERBiSVIHs9B moKQ== 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: APzg51Cgd3DOfX5YkuFzEF6hJv84BldCjiH94mwSEpkzvGcFyTd8Y/m4 28uWpuI00cN2MZR0LCatt0ZFqmpMbJl8IcWctzAlOoFV6B7OnMyjpmu6DqGRYtrlaNpTCDBlx8v KfJ68hqhxoKWw7Q3J55+e2cwbjG71/wB+ISoN3fSRJwlFrHkQS5oukOdrejEmqKI41MksDjhXpN IhLW3zVyDNjzmvDMq4wwgdLVCsG6OeSsblIwHuKEQQJahrvVLltwMyjeC1MZDX1c41DZg4k8N1k Gha0/ytpnUR9tjEhDb8t/ySYey/oMXmT0zSaQDwG0FRZP65B1fluucCWOTY825TXBMqO8waWNpI l0WB02EjOdXyFtzF1n56rya/0o8nOPkc16mJfDCzDfZex1DghkGMbbc9DE0dsaD40KLPLVf8jg= = X-Received: by 2002:a1c:40d5:: with SMTP id n204-v6mr19474040wma.44.1537351721399; Wed, 19 Sep 2018 03:08:41 -0700 (PDT) X-Received: by 2002:a1c:40d5:: with SMTP id n204-v6mr19473985wma.44.1537351720666; Wed, 19 Sep 2018 03:08:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537351720; cv=none; d=google.com; s=arc-20160816; b=0lamJoijThnIH+VEFvFOpmt7Rzn0CWRhhrYK55XFJFKNDwFdXjvgT4NQTZJ2kHu+To tZPRaOhYt8BlamzVoKOSbhNquCiIbaKaoAMV7YhfslITduRjBTtjDJA8GsX0eymudB+Z cVSj963YGG3rqyzdmzVUwGTuuVE4JP01HRPKy2AV0NmTr7z1IVrHJQxF48J9snpPqvpD M3K60q5nz3+D9o3WooX9OdtYvRI/sa6WUr1Tu0ovX3LhVQx8bw3W/8ZXcLBiTToKFBPc AkOTIKS/kka6G5w+bHcCtSdJR4DbZYk3PTukoP12A3pRtSN17AEQCwR2YuyXWd9TlAG6 84jQ== 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=nPK6uXZN7cckrZujWIB4/aDojr48F0Bx+xBF9fcQrF4=; b=SYdu7BIfxKVAVwsaugFhd373SZdfraEKe9uI9pmlU2nHULwvbdV64kEEplfZESUuLe TDQbhuIveHojYRy8OyW3zpKF4TT1gpFUhHUExcJ06jLUAjUl9ZREXdCr0BHqTv7TnLMD T/LfcsRJbcRkboBvz3rf1L9AAJswSwnWRCmnKQ1xhweHzuFxMyXvyVDl5NexuljJZrxJ 0DnoZz59HaDIjvxJD6Dze9sXXiNK5RO8LgVKTEh6pbqkW4l7igROMvJFR6+WOcDtB5Ra AQFee06Fcbdweb2Xeb7FcyBL8duEV4pDCJC/EtOLfSMPez1JSR088iRqC8DMv3iJZo78 oHZQ== 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 c10-v6sor15438814wrm.23.2018.09.19.03.08.40 for (Google Transport Security); Wed, 19 Sep 2018 03:08:40 -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: ANB0VdYALQtAORNJdn6aMvxSVqH7BWIqAeiJ5ZgblOChmk/IZbwXHg1zQie6pixLaKS/+9PJwHGCww== X-Received: by 2002:a5d:68c9:: with SMTP id p9-v6mr27824256wrw.108.1537351720351; Wed, 19 Sep 2018 03:08:40 -0700 (PDT) Received: from techadventures.net (techadventures.net. [62.201.165.239]) by smtp.gmail.com with ESMTPSA id d18-v6sm2982148wmb.33.2018.09.19.03.08.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Sep 2018 03:08:39 -0700 (PDT) Received: from d104.suse.de (charybdis-ext.suse.de [195.135.221.2]) by techadventures.net (Postfix) with ESMTPA id 2ED381253C4; Wed, 19 Sep 2018 12:08:38 +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 3/5] mm/memory_hotplug: Tidy up node_states_clear_node Date: Wed, 19 Sep 2018 12:08:17 +0200 Message-Id: <20180919100819.25518-4-osalvador@techadventures.net> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180919100819.25518-1-osalvador@techadventures.net> References: <20180919100819.25518-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 c2c7359bd0a7..131c08106d54 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1590,12 +1590,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); }