Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3312073pxp; Tue, 8 Mar 2022 11:39:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJycULnvFTNicWEkdYThdejD9pG3aOqLGeyvHAP6+vCfxvY3YGHHlpyGfC/cGKPtdBwpABzU X-Received: by 2002:a17:906:7942:b0:6da:bdb1:3388 with SMTP id l2-20020a170906794200b006dabdb13388mr14598388ejo.236.1646768340357; Tue, 08 Mar 2022 11:39:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646768340; cv=none; d=google.com; s=arc-20160816; b=Mx1I9u9A7jpGNjlPzTUAPl2IZoUwl/bV71ids+E9I9Tq31fm9l+7ACgqxfEDqMJCh5 bCTs/5W3g8ZDgXUXyWts7wjY7MH5jFQBuIHRS4u9MWLMRjEwMcsLSRbHrXGEluD8G7QM 57FbAK4bl5R8ALhDZa20dHTUqmePbjKA1tWS1Jkhz3k3Ah6FRdIHUQFpFkood0g6YSUY Zx3Dcw1t2d+aJ8ZQNPL82+7cbJ/jkpSo5mCkHyKWq/6ODckCzy/kJqmd/rmk4h3R6saJ DQHI28pH7oBieLsbFFfP5kMYfIncL9gZw90oS3pASGc+cXt1XM0HYsbqRsMt0ubbbeEe Yqyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=0IfmFdPIHuTa75Qa/8oUKNFdCQJv+DchlDBS9H5YG4g=; b=uY+wXuxgPeks3MRgzk/GXNzPyTgrvvV/D7AO25SX3BQNVENUDUYGCAb5MpQkvAe1mT yYJVOgJnAKYOQhGjrfENSYo0zD6Cp26fxxfS48rR+/EW9qHoOkzX8YZXOoW7pnRswIjp 7dwgZoKvUuCe+Y2qrK7qEjtT+9LkRSPK6HAzFC9IXzHOVJSv8L7pHmZLM4C2YPlAD0xE 0f48iqXFMkM5y9BqdEzJMvI7haLpLLvvmr94wVhb+CZ99uXg0Qz6nynNacEEfzwkjjWQ AJ11Q1o/2z2OJQUCfR8kt7D+wbvayEEu2sLijrV2k7YntmGJ7bBkjRl0Ck6fdQaXSKs2 JvyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=pBCnBqih; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=MmAU06sD; 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=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c26-20020a056402143a00b00412b6b680ffsi10574821edx.412.2022.03.08.11.38.36; Tue, 08 Mar 2022 11:39:00 -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=@suse.de header.s=susede2_rsa header.b=pBCnBqih; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=MmAU06sD; 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=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345733AbiCHS6L (ORCPT + 99 others); Tue, 8 Mar 2022 13:58:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349876AbiCHS6A (ORCPT ); Tue, 8 Mar 2022 13:58:00 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03D6254186 for ; Tue, 8 Mar 2022 10:57:02 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 8C626210ED; Tue, 8 Mar 2022 18:57:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1646765821; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0IfmFdPIHuTa75Qa/8oUKNFdCQJv+DchlDBS9H5YG4g=; b=pBCnBqihs3rV/BlNOD7j+ZB76sI0/mQiVbUmo4Y1slWqqutSwmU941y0E92p9zs+axP5MA 1N+zo8cVSDUtuT93RJnEu+h5Hmd0aAGCGkKl6TrGsQOB6p/W2jTzLxUYBv25M8pARnacJd U5L/w/1zP7/0J8LuxVlGQrIxaxK01qo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1646765821; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0IfmFdPIHuTa75Qa/8oUKNFdCQJv+DchlDBS9H5YG4g=; b=MmAU06sDhhgGSHT7iox+uiNH8sbWBaWDyuuLKEmA5kKxjoS95T5mEkPL9CF5+KuDjuqh5g wV4kmO6vJWq0qEBw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C7F7313CE9; Tue, 8 Mar 2022 18:57:00 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id yIJwLfymJ2IBRAAAMHmgww (envelope-from ); Tue, 08 Mar 2022 18:57:00 +0000 Date: Tue, 8 Mar 2022 19:56:59 +0100 From: Oscar Salvador To: Dave Hansen Cc: "Huang, Ying" , 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 Message-ID: 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86383ac9-e5f2-1a2e-dd19-02e39714a3fd@intel.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 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. Thanks -- Oscar Salvador SUSE Labs