From patchwork Wed Sep 19 10:08:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oscar Salvador X-Patchwork-Id: 10605581 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 33380112B for ; Wed, 19 Sep 2018 10:08:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2944B2B59D for ; Wed, 19 Sep 2018 10:08:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1CE9B2B5F2; Wed, 19 Sep 2018 10:08:47 +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 B675E2B59D for ; Wed, 19 Sep 2018 10:08:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1E85B8E0005; 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 14D958E0007; 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 DFC478E0005; Wed, 19 Sep 2018 06:08:41 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by kanga.kvack.org (Postfix) with ESMTP id 6F4E88E0001 for ; Wed, 19 Sep 2018 06:08:41 -0400 (EDT) Received: by mail-wr1-f69.google.com with SMTP id i11-v6so5195641wrr.10 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=thpIlUtOEixjbYz3iacVqH1ZUY3x4M6r2oBABcQxPm8=; b=ajqcXodhf9Ley29p6MLPiTqtKfaCYK2Oe8Zns1yKfJqMoQvz7TgLdVHUnk1s2kVZ4y XBnsGaBIeRRO/W0uJy4WLttM51NX3oxhp2s1H5239BlMySYVjAlKbfaHDwrwJpwTV+6s XYAWVBe6PFZhLXkrZYolYlK6qgHh8APlBKf4OSkL2oniCs4zbpQOiX3MXjtR8nIVTJ38 m3B8soPb1J5NlxImTyjy2yluZCMsXMI9+UuRIqrNVv8dW3BL0DJuuEacbJ+e16S1Pj4U MZUKh75rVzpTIs19cD8Ow1Kbmfz0jDWWYBENoyfOTo8gk5k3wNpbl5KLOOMdwXyoJcyU eEqw== 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: APzg51CPC1eLJ+hLIV8r2B7Uu+BaKQHdf60QxM8A5t74EoZCCWSW/K57 C+bn0+10BpBLh+STY3TYyXp4xV3qDGVH1+ooJ7lFCc2TWCU4FFC6KLcUIBhQyB6Pcpxzch/dxeB 9LvuhD9AEeiXEDPvxVNO4WEHqCv7jKbGJV2oR0FsRbD+lX6sr2nryCfRL4RG0P+grj9+rBzjWwN KRJbfp+difuY1d3hj2p7JEMNRPH5YsUS+G/lVT7A6m9y1C5xBVtJ9LPURAKUpBR+XK27hP+ln0b OSVOjQFWEkKMj0M98qXr0PuJo9vNC5aivm5PBwCi1Ho4KoH7/oCOwZv0p1nTprd6V/3zmxLBckc dSTwTzP+8d0/SQYImSqyTudyGxdsAIu9X9/Q1hXqoLn41tkzGfqUX6lvMi7XTM7OdPw4Vmpi8Q= = X-Received: by 2002:a5d:6243:: with SMTP id m3-v6mr28297574wrv.179.1537351720980; Wed, 19 Sep 2018 03:08:40 -0700 (PDT) X-Received: by 2002:a5d:6243:: with SMTP id m3-v6mr28297500wrv.179.1537351720154; 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=ZsmLw6ton3z/tC9Y95UYu9OPnkxlkB4dXO1mdTF17WZ4k5SY2/m4mL/c4FS/nNjRg5 /WmRbIATWWpn1bCi/i3Pbz0CPvKBpptugmESNULnJph+zmMcqJFrdQmgAJyona/k3Hca f8zYm6qMbnjBogWAaEX0gsld9+qzCqiEdXZ9xu9XKSPswcFoq8OkATQTLklECjPjOOqV opG/mSZheCcCXFnhoFRiu84DGIzDmeaWOJtl/PRveli4vhGX65rYbUx0I9sGQSRp4Dhi XzthOFFu9hRfXDZz/XdeBuigzXOPUuQfXj6Xzav0/FXZvfxAkfjaoLIdTJTgimFIYRi/ XfCQ== 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=thpIlUtOEixjbYz3iacVqH1ZUY3x4M6r2oBABcQxPm8=; b=ltIGJVMkNBHMJzr+EdCrm6eFUwYk8bPYGjimiEM6+8W0iFeJN7vNeOCQcg8+zqOOwX 39+Fzk1QJSH6ebprmupv4fZLiyhpYTnQeh52Mp3b9K1Y0lMtVMy65D7gF9xh31L1KnM2 U3cw4bWNpYkKXiHAeDaKCYFJm0SsGl7+7MAE+jAfUu447xEFohJ41Baj9Q/cAWzZykR4 QvSWSGyiGDYV9V38BDfb4g7IRt2X7/Ry9G7S5NUGeFKl2ebDwD6QDgvhnq7hRKrsygLc 3ikL+Qj3G6OLt8bzKvejmnnhqvDGRw5rwTvn1z2/NJNADfRaqjojMyWnz+f+OrkDvVDx 0MfQ== 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 y191-v6sor9532365wmc.9.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: ANB0Vdb9hbUjE5up832+eC7sgpf42oWyYQuNo3UFhWu4SB5IZgjb3XeecE0Hqcf9MEGI2nfbZKd9aQ== X-Received: by 2002:a1c:7704:: with SMTP id t4-v6mr18488447wmi.136.1537351719861; Wed, 19 Sep 2018 03:08:39 -0700 (PDT) Received: from techadventures.net (techadventures.net. [62.201.165.239]) by smtp.gmail.com with ESMTPSA id g7-v6sm18529017wrw.30.2018.09.19.03.08.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Sep 2018 03:08:38 -0700 (PDT) Received: from d104.suse.de (charybdis-ext.suse.de [195.135.221.2]) by techadventures.net (Postfix) with ESMTPA id E9D441253C3; Wed, 19 Sep 2018 12:08:37 +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 2/5] mm/memory_hotplug: Avoid node_set/clear_state(N_HIGH_MEMORY) when !CONFIG_HIGHMEM Date: Wed, 19 Sep 2018 12:08:16 +0200 Message-Id: <20180919100819.25518-3-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.000018, 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 Currently, when !CONFIG_HIGHMEM, status_change_nid_high is being set to status_change_nid_normal, but on such systems N_HIGH_MEMORY falls back to N_NORMAL_MEMORY. That means that if status_change_nid_normal is not -1, we will perform two calls to node_set_state for the same memory type. Set status_change_nid_high to -1 for !CONFIG_HIGHMEM, so we skip the double call in node_states_set_node. The same goes for node_clear_state. Signed-off-by: Oscar Salvador Reviewed-by: Pavel Tatashin --- mm/memory_hotplug.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 63facfc57224..c2c7359bd0a7 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -731,7 +731,11 @@ static void node_states_check_changes_online(unsigned long nr_pages, else arg->status_change_nid_high = -1; #else - arg->status_change_nid_high = arg->status_change_nid_normal; + /* + * When !CONFIG_HIGHMEM, N_HIGH_MEMORY equals N_NORMAL_MEMORY + * so setting the node for N_NORMAL_MEMORY is enough. + */ + arg->status_change_nid_high = -1; #endif /* @@ -1555,7 +1559,11 @@ static void node_states_check_changes_offline(unsigned long nr_pages, else arg->status_change_nid_high = -1; #else - arg->status_change_nid_high = arg->status_change_nid_normal; + /* + * When !CONFIG_HIGHMEM, N_HIGH_MEMORY equals N_NORMAL_MEMORY + * so clearing the node for N_NORMAL_MEMORY is enough. + */ + arg->status_change_nid_high = -1; #endif /*