From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 943E6C433FE for ; Fri, 11 Mar 2022 02:39:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F28438D0002; Thu, 10 Mar 2022 21:39:54 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id ED83B8D0001; Thu, 10 Mar 2022 21:39:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DC7218D0002; Thu, 10 Mar 2022 21:39:54 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0250.hostedemail.com [216.40.44.250]) by kanga.kvack.org (Postfix) with ESMTP id CC9B48D0001 for ; Thu, 10 Mar 2022 21:39:54 -0500 (EST) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 7024194FCF for ; Fri, 11 Mar 2022 02:39:54 +0000 (UTC) X-FDA: 79230550308.30.382D572 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf28.hostedemail.com (Postfix) with ESMTP id E6153C0004 for ; Fri, 11 Mar 2022 02:39:53 +0000 (UTC) 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 07F0D60B04; 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-Rspam-User: X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: E6153C0004 X-Stat-Signature: h7d38njuu9hcgj8jrqxbz8tppwa97nz9 Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=QlsrF9K3; dmarc=none; spf=pass (imf28.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-HE-Tag: 1646966393-184653 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.