Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3591023pxp; Tue, 8 Mar 2022 18:15:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJzKyK7VF5sJoguudhvfLLO9jl0l49KB/MiMprW+VExI8O2k7z7ZgvD+59xYKKTbToDanE7M X-Received: by 2002:a05:6a00:24c4:b0:4f7:2fc6:50e8 with SMTP id d4-20020a056a0024c400b004f72fc650e8mr5916129pfv.63.1646792152102; Tue, 08 Mar 2022 18:15:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646792152; cv=none; d=google.com; s=arc-20160816; b=Jc47J3aH+PM+C4/4LyTL9xuU3x3gJqva+kPRnWGEuYLAdFqZujwXb9EkHZRiRqPmcB WIqC27ThwA+uOFcRPmdLAddUsKQzn0kSvfU8IzqN1t/HlZUsLVCmaGGRnJoPQzT37b2f 3tJ7AY6eJJeScL+wyiHyevKhdtllLnyC/oa4Msj4NEqx9mSExs8vbtThAi9YjXqE0Qnp n6RAw07p2fF02HOkW+OySnGEc/RssvUMuyqal/Ezilc9Gp8y6LabAqcL5LNu7C5J3RlN ZdPgWu6uT9HQF3VQ66gQ+W3gKWA7SNCFl97sNhJsjA8NnPnqGYQ6FkHH7LgbnOc93t9F vEtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=tB/+WngaunEEx25x1h3Huwo4G18ovJciFXAJZOHvNIw=; b=illj1vX9mxbJvYf/dFHqptSLobFOu4puEbJRU0a6B8qxR8OgNUnn09EQQHds+ma7R1 VuHcDS1mWRoFILAyS0SURMUgsvQd+kulLjble8bM5Z8jCHSpLV/udH4azvWxLj1cSy5n M1wEdXMeMRq8ur9lVTZhT/ABe/l8RdBR/O5W1u7bsKjTeqYgq5fldNLfKm/sXYIOmfmm OewgVUhw1JD0C23R+hzDr8uJAli2sLAHWJEuXmG+c5TNoIY8JCsFKmXkWtRyhjQ4qsOx EylHvKpKFQlDPvP6rf3BDk9t3+2cGIfj7m8jE1AISw50oayDAvkDkjDMnWfMJKe2UugC fTCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GYVAVapQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id g24-20020a62e318000000b004f72cca0eefsi522112pfh.329.2022.03.08.18.15.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 18:15:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GYVAVapQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DCA3C17584B; Tue, 8 Mar 2022 17:09:13 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231137AbiCIBJk (ORCPT + 99 others); Tue, 8 Mar 2022 20:09:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230519AbiCIBJd (ORCPT ); Tue, 8 Mar 2022 20:09:33 -0500 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44F0214CC87 for ; Tue, 8 Mar 2022 16:51:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646787115; x=1678323115; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version; bh=rTewoYY5iGutquVo0W7aUnC1d1O9Xf62XUlk7Bo0QUQ=; b=GYVAVapQiDYTUgv/rnTsr7PnNCcG9BAhC6/xMJ3F82g0X87L+Iweofc7 zr5j9jsWGahnayF85wKx1QLanKCUbl1B6dTRSeu7lS2LLQ8vJnLXOhCl0 sCU/o5dX4A9Mcdf+3whjnDYkbgvvVotB4Z/CA3BQf9w6Fmg5aM4j3GCu4 u7j+meckmwi0QoZZYJEs8vvm58mMVYm4p8pCaZy9Mo4/ToycG2M7d3KeI 3yNnqhgisTrIYN/hWSEllZTrnJIhS9bk7A07yoA7Ei93bHodVjZs2g2Yn jC2ibZPnim4AD1wruuxeUNZwEjP0UQZJYo8U9emqgfvw6T6XTLk+zSIKL w==; X-IronPort-AV: E=McAfee;i="6200,9189,10280"; a="254790602" X-IronPort-AV: E=Sophos;i="5.90,165,1643702400"; d="scan'208";a="254790602" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Mar 2022 16:29:44 -0800 X-IronPort-AV: E=Sophos;i="5.90,165,1643702400"; d="scan'208";a="537793799" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.239.13.94]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Mar 2022 16:29:42 -0800 From: "Huang, Ying" To: Oscar Salvador Cc: Dave Hansen , Abhishek Goel , Dave Hansen , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Zi Yan , David Hildenbrand , Yang Shi , Andrew Morton Subject: Re: [PATCH -V11 2/9] mm/migrate: update node demotion order on hotplug events References: <20210721063926.3024591-1-ying.huang@intel.com> <20210721063926.3024591-2-ying.huang@intel.com> <4e8067e1-0574-c9d2-9d6c-d676d32071bd@linux.vnet.ibm.com> <87pmnb3ccr.fsf@yhuang6-desk2.ccr.corp.intel.com> <86383ac9-e5f2-1a2e-dd19-02e39714a3fd@intel.com> Date: Wed, 09 Mar 2022 08:29:40 +0800 In-Reply-To: (Oscar Salvador's message of "Tue, 8 Mar 2022 19:56:59 +0100") Message-ID: <87k0d4ge8b.fsf@yhuang6-desk2.ccr.corp.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Oscar Salvador writes: > On Tue, Mar 08, 2022 at 09:07:20AM -0800, Dave Hansen wrote: >> On 3/8/22 02:27, Oscar Salvador wrote: >> > @@ -2043,7 +2044,12 @@ static void __init init_cpu_node_state(void) >> > static int vmstat_cpu_online(unsigned int cpu) >> > { >> > refresh_zone_stat_thresholds(); >> > - node_set_state(cpu_to_node(cpu), N_CPU); >> > + >> > + if (!node_state(cpu_to_node(cpu), N_CPU)) { >> > + node_set_state(cpu_to_node(cpu), N_CPU); >> > + set_migration_target_nodes(); >> > + } >> > + >> > return 0; >> > } >> > >> > @@ -2066,6 +2072,8 @@ static int vmstat_cpu_dead(unsigned int cpu) >> > return 0; >> > >> > node_clear_state(node, N_CPU); >> > + set_migration_target_nodes(); >> > + >> > return 0; >> > } >> >> Yeah, those callbacks do look like they're reinventing the wheel. This >> is a much more direct way of doing it. > > Then let me play a bit more with it and I can cook a patch unless > someone feels strong against it. This looks good to me, Thanks! Best Regards, Huang, Ying