Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp542703imm; Wed, 19 Sep 2018 03:10:13 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb8+Z/bVnWml2ILiESGHlAkUf2sihxPpKPWiAMVaKWlbpO+mmN6mNgYkuxt+/Lc12VdJimc X-Received: by 2002:a63:e40d:: with SMTP id a13-v6mr31761980pgi.289.1537351813619; Wed, 19 Sep 2018 03:10:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537351813; cv=none; d=google.com; s=arc-20160816; b=BFvrgrCapZlV5x/S188QA/nbJrzX7f4BnHAWeBDXfrTQyaF5l34yRtAmFG0fIgmdCD S9m4aeqhLcjTAMSdTxldLWGozLcfsZ5H94HstpWbXmJ+lVZCm5oNHHTItxnUZmkkdfiH 81byD2C2Qm8vtNqD2g8ZJw0b/lEdI6DxDkFWJfiIr3OeGj/O9TzxbgzkhR9UAdpbazZB DMY9O1bDsgpes/WaFK+eztuQamAeAGGoQ/axe14+AAdVozyab91B2PwiXDu9r5Yrps4G zX8atzB9G5eZJIu9fmDWeS2Z3bmydUefz1eaNdFKIzOamFS1MLi9N5CAdSqPhgZ0NsTV rpQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=thpIlUtOEixjbYz3iacVqH1ZUY3x4M6r2oBABcQxPm8=; b=P8Y/+MmTNUqfEt6nEduFAci4tuDgamT47ZIQJLUucAfaDeV29Z41AB3/YRCVkzk5Oj l6TQMLeVb2mHXiU3qOoEqLHEyWfpSV4h2VpwnB4FnH2TnE8WRnpjUNl2OBp+KMF2K2vH kwhAvTWhAaFSLw0fixQffPQpZHJjIr00uG6CGHYSAS3dyGZ31+TwdsmHtUdt49MSgfF2 HfkzblexgnDU3r+3N5LRGvEwQEvBzwaAjpFxL5F8EqGjvPWBhDkuh1cs4q0qWkd6iwKQ gzI0GCRf3XvL4WNQP0yLbJ21aUTKJebTWmgOP1f1gCJcm4BYWQGL4BwPwZvBTJhWBEei o7bw== 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 20-v6si21723260pfr.242.2018.09.19.03.09.58; Wed, 19 Sep 2018 03:10:13 -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 S1731220AbeISPpw (ORCPT + 99 others); Wed, 19 Sep 2018 11:45:52 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:36935 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731154AbeISPpw (ORCPT ); Wed, 19 Sep 2018 11:45:52 -0400 Received: by mail-wm1-f68.google.com with SMTP id n11-v6so6196455wmc.2 for ; Wed, 19 Sep 2018 03:08:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=thpIlUtOEixjbYz3iacVqH1ZUY3x4M6r2oBABcQxPm8=; b=WQEF4p4jcXmvuO3rSe9BUeg069AdmhAQTySrd3J1Ga41G/XRiOXfcLYcOguRfi9QVb aD1UR8YiRHtA994HYlwF9QxqnnmUfgwy7LesIF3UVB3l0HVCJSWQWJKDl9w6fRa2QBJ3 OLipbum34Adi0bXRIsxBdzzgsfXCu47gmUCQfssEz4c4JU4hlcISW2tyH1fyvEspE4UM smhmABrvg2nC5Nz5ZTSU23WxStuQNgRK1krRDZfSTOpnY2+IHY1nXjzUsiyJVwX5l/9b bA3VgUCB3QdjKmO89KA72TZOTCz9rwmA7ieHBWsCh5Y8H6/vlm/Xy3lSBO26apEtExpe EEeQ== X-Gm-Message-State: APzg51A8wQ3A6DppXR54PkdnKfl9+vTyEh81AADC5NpGCxCOwnbEzx7M YC4cOA5R0rV2XLGsddyPSfSKURhnG58= 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 /* -- 2.13.6