Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2335775pxm; Thu, 24 Feb 2022 23:09:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJwWXmpLPDDh+ojGOedYa19bpMVDWtmCbcoA/+QH6boEAxh/Mtjl7SmIZfNpjEf8ocUIpRP0 X-Received: by 2002:a17:902:b704:b0:14b:831a:e4ce with SMTP id d4-20020a170902b70400b0014b831ae4cemr6353323pls.156.1645772954215; Thu, 24 Feb 2022 23:09:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645772954; cv=none; d=google.com; s=arc-20160816; b=NQdu1h5Ikp0WZYhqP4i0lAvMgnyxSPRFUqG3z2mu+1ptPJ4i5QoGwVaEGut37I0nO8 JFwwDdNJnf+tFGV+vrR5jjfmpfMJKMJjFUqDMpSQb15kyhxZjKml8BXnXHIeAGZ2anlI Hm1fSXMMY8Aaz2ZkEJIInhPNefgslH3LBVgZZsAfDPymEijiEA1rKvBsSt9rggkVCneF cKhvhJ5ooXbXFMUZy+eNi9HnAz5912Wa89T9eKSxVnbjJpCszDZ2qrkzuAbUgx1v9OMa Uhd+ssuNOdC2C8JYXE2aApSVh/CpDskcFggZO2j7K9hPlojK5EJ3xqSSwRlHGOMOAOvH lgEA== 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=IIT0FQ0qH6fVTI3fUmcZ7QVSXMO6fnLkB0X4mkt9URU=; b=TawDdwOKgGZ2Ko+VF1o6DHrlqaFSwtNeHNi8ypaJ3qXuczFFbtYKPxXA+ivugYIYxH 6S93k2u9/B5W8zQs9NVkMdPpsV9v4eWbXyP1pWbWAL7Xd3aNRijrdR3JvQxmDmluiUxW RY3mj+p/YiymcwJ446xHTP7RceJV5oUDWyADcUOlw4k92i2s4lFH2hGFkqX9SNJ3+x4p hB/sjhaH92Thtan+rU2LnG7J0ybBiBu42zUN4znZlS7SYCxYgmrN9ZMHiSWgXW8VDQ6B PbZO3izMQgnW8D3RrNrV2prcr0JY8bbAerUk10XULbyY/MIvvbMI9flnkeIiCmcHUh/h PEGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PJBlVr7v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p18-20020a17090a931200b001b96a1a4584si7221227pjo.26.2022.02.24.23.08.59; Thu, 24 Feb 2022 23:09:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PJBlVr7v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236786AbiBYCc4 (ORCPT + 99 others); Thu, 24 Feb 2022 21:32:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230028AbiBYCcz (ORCPT ); Thu, 24 Feb 2022 21:32:55 -0500 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8068D18887A for ; Thu, 24 Feb 2022 18:32:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645756344; x=1677292344; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version; bh=Te4PHcJ/B1DO1cDp06aZcLXva0MLz3mhGNrCcZ9Dsz0=; b=PJBlVr7vINRFPddenXJ3mjTg0bm2YooVqP58uH5s8AOI9C6dR0I4ppBq xFyZRftht6tpW56/+wCaUTPGkcJNErJiRZijxyC7+aFjeurpsNPBsx5c6 2niwDlElVtCyrDbeARXf5Y2qqygVeKH8yHC9GiHtXhsz01Au4ybyQE5LR 9T4/R6kt/vGKbUDXy2dDvz3eZ0xBXOkZTE04day/L4zTxr+DmkUvnXmsZ nJc/tCuvii1Kn4U4wWckC4F4811YxDie5JsPqvbWATTg5xFdsFnQhQjyy +HSdFYWRTRkHiiHgYotyGYwbHGCpMs5sLemWi3Pz9VZkqbJM/u0D2xc5s Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10268"; a="277035410" X-IronPort-AV: E=Sophos;i="5.90,134,1643702400"; d="scan'208";a="277035410" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2022 18:32:24 -0800 X-IronPort-AV: E=Sophos;i="5.90,134,1643702400"; d="scan'208";a="628702227" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.239.13.11]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2022 18:32:21 -0800 From: "Huang, Ying" To: Abhishek Goel Cc: Dave Hansen , 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> Date: Fri, 25 Feb 2022 10:32:20 +0800 In-Reply-To: <4e8067e1-0574-c9d2-9d6c-d676d32071bd@linux.vnet.ibm.com> (Abhishek Goel's message of "Fri, 25 Feb 2022 05:07:15 +0530") Message-ID: <87pmnb3ccr.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=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham 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 Hi, Abhishek, Abhishek Goel writes: > On 24/02/22 05:35, Dave Hansen wrote: >> On 2/23/22 15:02, Abhishek Goel wrote: >>> If needed, I will provide experiment results and traces that were used >>> to conclude this. >> It would be great if you can provide some more info. Even just a CPU >> time profile would be helpful. > > Average total time taken for SMT=8 to SMT=1 in v5.14 : 20s > > Average total time taken for SMT=8 to SMT=1 in v5.15 : 36s > > (Observed in system with 150+ CPUs ) We have run into a memory hotplug regression before. Let's check whether the problem is similar. Can you try the below debug patch? Best Regards, Huang, Ying ----------------------------8<------------------------------------------ From 500c0b53436b7a697ed5d77241abbc0d5d3cfc07 Mon Sep 17 00:00:00 2001 From: Huang Ying Date: Wed, 29 Sep 2021 10:57:19 +0800 Subject: [PATCH] mm/migrate: Debug CPU hotplug regression Signed-off-by: "Huang, Ying" --- mm/migrate.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index c7da064b4781..c4805f15e616 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -3261,15 +3261,17 @@ static int __meminit migrate_on_reclaim_callback(struct notifier_block *self, * The ordering is also currently dependent on which nodes have * CPUs. That means we need CPU on/offline notification too. */ -static int migration_online_cpu(unsigned int cpu) +static int migration_cpu_hotplug(unsigned int cpu) { - set_migration_target_nodes(); - return 0; -} + static int nr_cpu_node_saved; + int nr_cpu_node; + + nr_cpu_node = num_node_state(N_CPU); + if (nr_cpu_node != nr_cpu_node_saved) { + set_migration_target_nodes(); + nr_cpu_node_saved = nr_cpu_node; + } -static int migration_offline_cpu(unsigned int cpu) -{ - set_migration_target_nodes(); return 0; } @@ -3283,7 +3285,7 @@ static int __init migrate_on_reclaim_init(void) WARN_ON(!node_demotion); ret = cpuhp_setup_state_nocalls(CPUHP_MM_DEMOTION_DEAD, "mm/demotion:offline", - NULL, migration_offline_cpu); + NULL, migration_cpu_hotplug); /* * In the unlikely case that this fails, the automatic * migration targets may become suboptimal for nodes @@ -3292,7 +3294,7 @@ static int __init migrate_on_reclaim_init(void) */ WARN_ON(ret < 0); ret = cpuhp_setup_state(CPUHP_AP_MM_DEMOTION_ONLINE, "mm/demotion:online", - migration_online_cpu, NULL); + migration_cpu_hotplug, NULL); WARN_ON(ret < 0); hotplug_memory_notifier(migrate_on_reclaim_callback, 100); -- 2.30.2