Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp199576imm; Wed, 22 Aug 2018 02:35:26 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzsc4I3M8q9hemdNWoTh7UWmArOiI422cMSnjgEWc/NVAHy0pyxav7cEYATJFWTvcqZqKEH X-Received: by 2002:a62:c98e:: with SMTP id l14-v6mr56477037pfk.10.1534930526497; Wed, 22 Aug 2018 02:35:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534930526; cv=none; d=google.com; s=arc-20160816; b=I0dWgPZWhVQv3b6ID2AXWsld7d3+Lt9C9xc4iAnv1XMbkZRXaY82eLkc4GHj38xSjl 8aILkOLrGls+yp6Gzlc2VoiEnaBfKG07/AA8boDdfpDXYHRGtnYSxsJrclTuxLTL7Cgn ydZOYqzA/84v8m1Ic3X2gouhghqkOAGsuFp9vUhVDex34Z4YqCGzzMKkCz9JAySdu/pL DHwc305IwQ3aCcZOM51obD/marZE3X/I3bz25jXSWIoX0xYKvdNKk5xn2I80lJVDJKTJ +TbxICK7TbfD5VtWuY+W+CGgq3bjKxvhknEw7uOsHn3DdLTMtd0TlQ7fkCnWXn8Ykpnm CWeA== 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:arc-authentication-results; bh=zqnYEmFfSStfubGMhFL+km+dqzq3LfNEkBqGNnMeElQ=; b=jnpUObLdUukTttjN1LtrOvs050QPbYXkZNxwnFbFRecjgWeaCvIFKKA7VKJuM/p1z1 Pr7We6h4kh+I3gtyAN9xi/aOy+EJGu5PTEstSXBSV/Gwx8zT8ZYQRKCURefzsgjwvW/0 7J4nrIVbdRR/PVVeD/cVEeareEKDawhw/P0HXRfMdRCNmsNrWczgQNu0k4vPViK9Z4+t R4lR35v8oZJSMfFd7eJRRgR1Jg/ddOClaOXIwfZKbsax9d9Vt67BxEX1dd4pMA1ORpJn NY7yfFjsIfhmWytbePjAzZY9qWiBV8rOD0O7jjd8IUSNP/u35RjHLF9JsVZU4vlkZ0hP D4TA== 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 t1-v6si1242595plb.177.2018.08.22.02.35.11; Wed, 22 Aug 2018 02:35:26 -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 S1728587AbeHVM4j (ORCPT + 99 others); Wed, 22 Aug 2018 08:56:39 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:38314 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727835AbeHVM4i (ORCPT ); Wed, 22 Aug 2018 08:56:38 -0400 Received: by mail-wr1-f66.google.com with SMTP id w11-v6so1050959wrc.5 for ; Wed, 22 Aug 2018 02:32:33 -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=zqnYEmFfSStfubGMhFL+km+dqzq3LfNEkBqGNnMeElQ=; b=mT127ANW4sUa5UrYAAPiV2ytdwSh/40+7xEhQVCdd3/E6YLq+ogRvD3F9tJBC4nciP HtnCDGRsBtsmdxmMFApmY9scd8ZVoRTSXUsnOVC5hizAx+gI6/p9OqtuZKPzDvrqDZz7 Pq/0g8BGn8YIqaVjYjKdh6QtKibQaVpqp8iXeCoL3kxkjQvGLSGG0yEYxmmJkhu0veLD l3fCDbAhg2/I0AHT6E3Xy3tmknEFlFG6sVHDY39Huw2IqCxn8yleJ6GJvDMm/u0OLoO/ cz1kWeeMpUCiE5Cl0V0zLY3lTajYWOEEB7ieIDmNeK1E1Hin95ggIrci5VAZFfPqP+34 /8kw== X-Gm-Message-State: APzg51AxiXDe7vbUYPVVwfvpjSBCmzHMo2lkfjJzA4qOlivhods8cgNX 9whrgebSn/GMWM2QR57uNME= X-Received: by 2002:adf:9101:: with SMTP id j1-v6mr10482285wrj.3.1534930353055; Wed, 22 Aug 2018 02:32:33 -0700 (PDT) Received: from techadventures.net (techadventures.net. [62.201.165.239]) by smtp.gmail.com with ESMTPSA id q3-v6sm1148938wmf.21.2018.08.22.02.32.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Aug 2018 02:32:32 -0700 (PDT) Received: from d104.suse.de (nat.nue.novell.com [195.135.221.2]) by techadventures.net (Postfix) with ESMTPA id E69A3124A13; Wed, 22 Aug 2018 11:32:30 +0200 (CEST) From: Oscar Salvador To: akpm@linux-foundation.org Cc: mhocko@suse.com, dan.j.williams@intel.com, malat@debian.org, david@redhat.com, Pavel.Tatashin@microsoft.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Oscar Salvador Subject: [RFC PATCH 1/5] mm/memory_hotplug: Spare unnecessary calls to node_set_state Date: Wed, 22 Aug 2018 11:32:22 +0200 Message-Id: <20180822093226.25987-2-osalvador@techadventures.net> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180822093226.25987-1-osalvador@techadventures.net> References: <20180822093226.25987-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 In node_states_check_changes_online, we check if the node will have to be set for any of the N_*_MEMORY states after the pages have been onlined. Later on, we perform the activation in node_states_set_node. Currently, in node_states_set_node we set the node to N_MEMORY unconditionally. This means that we will call node_set_state for N_MEMORY every time pages go online, but we only need to do it if the node has not yet been set for N_MEMORY. Signed-off-by: Oscar Salvador --- mm/memory_hotplug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 60b67f09956e..4a89915e1467 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -746,7 +746,8 @@ static void node_states_set_node(int node, struct memory_notify *arg) if (arg->status_change_nid_high >= 0) node_set_state(node, N_HIGH_MEMORY); - node_set_state(node, N_MEMORY); + if (arg->status_change_nid >= 0) + node_set_state(node, N_MEMORY); } static void __meminit resize_zone_range(struct zone *zone, unsigned long start_pfn, -- 2.13.6