Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp255038pxp; Fri, 11 Mar 2022 03:46:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJzzFZjkgQTBUy8pTrd4z29BHLTUJjtKF6duGOUmDWZhpgNQcQJ0Hbc4bk1IVZalfXSFlDac X-Received: by 2002:a05:6402:2915:b0:416:cad2:d619 with SMTP id ee21-20020a056402291500b00416cad2d619mr3913847edb.221.1646999213058; Fri, 11 Mar 2022 03:46:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646999213; cv=none; d=google.com; s=arc-20160816; b=DU/MNpyQNLK7rYeYTvdtJD6xYaSaCiJ/d1ZjEpeW7U9TdRWQaX7PVSZJHutI3m+arZ I092ZjzKk64M2GW/B2U/FQpHKkW/bEZtvN3/l5V/xQeOSKnT573WYg1XscOi7VyN2wM/ arha4VGPNwwHqtHMUmTUCVLoTmlHg/KmrTNLcLdL93g65ytpcP2RwV6RCeq5DahqwVDq RlS5pmO/xIFBy3ZxvconrIU6PGcqgATI4qRT+bDESO5QvEKMfpFcj9AndtmS1FDKE0xO 9x+utw/XUrF1W/COENm07d/luo/ThGv95ZpKCQj1I3nPMpsNu4AE8DimlsFBdljqppeo 0xCw== 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=5fmy4mO8YyqRppMl8FcC0Q8C8t4IuVlyvWoBe/zMI6Q=; b=nr8ixhDryP+F9t/4nYWtT8XkBJAUGhVhFBvNmJC3cAnWUTHYdsY+bOgdEiCzW3q8C9 2DK9q9OY5Khx653iHGjEU9v79snfo2oGI9ou8F88xXj2v8aEmm15AnA3XifvOUohv88B LCUBrcg4B10yyoPYbuQLfdID8exVNNCYKoqxKS+owfDfRArX8ku+MlnsRRPeDrlhCDRY jo/vdXjGxSPMw8csMWYRYn+mbjfAjm1TCDYs+GfKLF7kWAKs6I42LGfR45d4kzW1ylO3 quDrMy8y1DBLN3yM9a4u1bcZRajSTe+xIZgXvG8aIrjcCk7T/fl1uDD16L/wWaVZr4mi uNZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=QlsrF9K3; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r18-20020a05640251d200b00415b4ce8c44si6070116edd.386.2022.03.11.03.46.25; Fri, 11 Mar 2022 03:46:53 -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=@linux-foundation.org header.s=korg header.b=QlsrF9K3; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240463AbiCKCkz (ORCPT + 99 others); Thu, 10 Mar 2022 21:40:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232908AbiCKCkz (ORCPT ); Thu, 10 Mar 2022 21:40:55 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EA1A119F39 for ; Thu, 10 Mar 2022 18:39:53 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 0825460B06 for ; Fri, 11 Mar 2022 02:39:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2FDE7C340EB; Fri, 11 Mar 2022 02:39:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1646966392; bh=EZlhFHY/Jt1mxxpZeR8oroVr47JrSXbcK5pFtBd5k50=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=QlsrF9K3VcIwclEe9QUJWTvJuXuX/4qPJoTKdPKI4SAj6cBV1Rr6asZ17SMII4AhB qSV+h7D7X6j/NoLreUHUhTFWhMZmRe18pKDbWi4wEq7j0Wpru8ZE5RbtriwABoFZ3e K1qcqbF9nqyTUir0olDajk71uA3TIc6kPh2aInIs= Date: Thu, 10 Mar 2022 18:39:51 -0800 From: Andrew Morton To: Oscar Salvador Cc: Dave Hansen , "Huang, Ying" , Abhishek Goel , Baolin Wang , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] mm: Only re-generate demotion targets when a numa node changes its N_CPU state Message-Id: <20220310183951.cb713c6ae926ea6ea8489a71@linux-foundation.org> In-Reply-To: <20220310120749.23077-1-osalvador@suse.de> References: <20220310120749.23077-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=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 On Thu, 10 Mar 2022 13:07:49 +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. What I'm not getting here (as so often happens) is a sense of how badly this affects our users. Does anyone actually hotplug frequently enough to care? If "yes" then I'm inclined to merge this up for 5.18 with a cc:stable. Not for 5.17 because it's late and things are looking rather creaky already. And I'll add a Fixes: 884a6e5d1f93b ("mm/migrate: update node demotion order on hotplug events") which is that patch's fourth such bouquet.