Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp788957pxp; Fri, 11 Mar 2022 15:10:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJzAwPGZP2+WhpdIGvslfkzhboT/Apfiumri0njXcyJWtqsYzz7jTylhyGnlY4lsbVc9j6E3 X-Received: by 2002:a17:90b:17d1:b0:1bf:1e3:ded3 with SMTP id me17-20020a17090b17d100b001bf01e3ded3mr24582657pjb.144.1647040203300; Fri, 11 Mar 2022 15:10:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647040203; cv=none; d=google.com; s=arc-20160816; b=EP250VMgLezTDdFt48SEI+5m84fexUfoc0yFdtAs0ZdTfikmi7yQxUbLA6/jezyhAL bWcMkepj5cBV9M+UGI+tBkzqoXZWsUKZ+lLnAgRQPYlxLjdeak4dczBNLEV7XHQJSsh3 Mx9/SyjWeR21A28sVG5tJJzd9S/bfTf47odN0bGk7eEcia9DoMXWCrifJKJLk26YTOem 2N27Cci7FAA23d/mt2B+egYkyzbr4exT52+Xr6Todt8PIsma4yyDjbT39gAAwNP7Dm12 8fxCO8Lodj49Ic2O9baZrp3KVW4tpdQN/lY+/I3nMXF2sbRAw9v6sdZOCRjsMv/XAniq JYmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=J/5cIrRMnEEh4vocrAoGpG9Mo/PW/skk5el+PZvTZjc=; b=hG4eAsLaBl/dchLgNwTIr7RzbC8M017r0xLBWw1m7VPuy/k4ob7V0YFhhgqriEB3EZ RkRo84d1aLQMEJ5D5V9OY0v69L0rXH9YppuiOO2qdN7qazlYTdame3s99U/sdc5aMEsK snUlU4Y13Yk6zzPS3Ed1r+U+tZg3jqqFe6hIGeZ/YqHjTy1EyDCi0OfYvTX4m6C+7NfD gslbvDWsryz1l3speEqipFFOsZUeYwN83cqR7w6vuMRPWpk2woNs+WoTBB/XYD1wlcT0 uIhbsucLFJL0kz0Fh24BHBJUV8o9mSQ2muE1rhilQlaA30E+IXInBB+O3yK2rsnrLJj/ pnlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=GwsZDdIu; 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 Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id ay8-20020a1709028b8800b001530ceb3a6fsi7426391plb.376.2022.03.11.15.10.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 15:10:03 -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=@linux-foundation.org header.s=korg header.b=GwsZDdIu; 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 641B2283B69; Fri, 11 Mar 2022 14:07:45 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232793AbiCIVD6 (ORCPT + 99 others); Wed, 9 Mar 2022 16:03:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238287AbiCIVDz (ORCPT ); Wed, 9 Mar 2022 16:03:55 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E77303467C for ; Wed, 9 Mar 2022 13:02:52 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9B31FB82396 for ; Wed, 9 Mar 2022 21:02:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1DDADC340E8; Wed, 9 Mar 2022 21:02:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1646859770; bh=K+SVF3NIC6AclGAEc157GL3w6NzdafbLPewFtDqSVgM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=GwsZDdIu5bwip/A6obnXFxBfi+WYu6RF1OUwfUL4x28lPu1gcUgU3dSf7BNb3S8U5 1P1a+63Qj9msEHdGm5YoIOjZywkf5jAMRFpbVQTsA8faitK8wrGQA6R+bXRkp+G5Ti 8WqvS5tb8LYBjaXVS7zgCps2LccoM0eiqAT1UH9Q= Date: Wed, 9 Mar 2022 13:02:49 -0800 From: Andrew Morton To: Oscar Salvador Cc: Dave Hansen , "Huang, Ying" , Abhishek Goel , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: Only re-generate demotion targets when a numa node changes its N_CPU state Message-Id: <20220309130249.60733272aafb3bd5f2e6b88c@linux-foundation.org> In-Reply-To: <20220309144644.4278-1-osalvador@suse.de> References: <20220309144644.4278-1-osalvador@suse.de> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no 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 On Wed, 9 Mar 2022 15:46:44 +0100 Oscar Salvador wrote: > Abhishek reported that after patch [1], hotplug operations are > taking ~double the expected time. [2] > > The reason behind is that the CPU callbacks that migrate_on_reclaim_init() > sets always call set_migration_target_nodes() whenever a CPU is brought > up/down. > But we only care about numa nodes going from having cpus to become > cpuless, and vice versa, as that influences the demotion_target order. > > We do already have two CPU callbacks (vmstat_cpu_online() and vmstat_cpu_dead()) > that check exactly that, so get rid of the CPU callbacks in > migrate_on_reclaim_init() and only call set_migration_target_nodes() from > vmstat_cpu_{dead,online}() whenever a numa node change its N_CPU state. > > [1] https://lore.kernel.org/linux-mm/20210721063926.3024591-2-ying.huang@intel.com/ > [2] https://lore.kernel.org/linux-mm/eb438ddd-2919-73d4-bd9f-b7eecdd9577a@linux.vnet.ibm.com/ > > ... > > extern bool numa_demotion_enabled; > +#ifdef CONFIG_HOTPLUG_CPU > +extern void set_migration_target_nodes(void); > +#else > +static inline void set_migration_target_nodes() {} Compiler won't like that. Please test (compile and runtime) with CONFIG_HOTPLUG_CPU=n. > > ... >