Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp624131pxu; Wed, 7 Oct 2020 11:24:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/hE5SIAo27dHof4fB+2i9Nj1WH90KYGaL7toOwqqU+x1EjnfAsTWn6zXyjtuX8zIgw73F X-Received: by 2002:aa7:c586:: with SMTP id g6mr1399206edq.343.1602095046341; Wed, 07 Oct 2020 11:24:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602095046; cv=none; d=google.com; s=arc-20160816; b=Oi8OOT2soEuITR7jUGmg8uYvNY4R3zGSeqVHhXc3XbiVAthpEVnLopWsvyDcsGzOR7 EoaxywIEH6PptTHRttXLEUkNXElhDZAlKCEQDJYqsqnCxHuVF5ZRTLumD95/trmTHKsg AyHoJq00s0J2+pKfDzYdcfep2sWt6+VPuxAwVRDUP9o4k2zrYWOkuqIJe4mRarmna3mO dyFnxIBCEVc5bMjNqR6dLEcwLXyAkqpJWjWzReMe9Pk20q65UUQkyNnmnD24yCVjagxV KIRbPaZNBgtipZyVeBgF0q40cAvmMXfe0zT5cxSxJ9QDQH9aWbSvP+g72EnN0HiTQ7go O23Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version; bh=k7Pal0C8K6GUbqPZDL51gRH01eCW3OsBJxcr2iB9+nk=; b=gUeFVVDcydzqpH6xk+QP3yNe4fVBKGcdGh8KC0BcuM5oadz/YJrMwkseHw/EKEvd+B Adsps549szrxfgqBOrADO41uMG0+trCQFTlPRsiB9bDY9B/L5hU464pZzw44qQoACHeX Vt8rOQPCZ6YoeOKMGILmaYHw4u0/RWWyobjcZjhK/T8rGY9HXVrpm8LoC/XfUwq/sa0x owdsUIrR9ApKsmyCl3moLeJ/n02tY3n6duc48wwhQawJGVEYI0GUSovkWvfpTcXvBLpt KF6dwFbVygCRR/QdjWoGHeiWX4h1Kpe9lWYBUJHEiNn9uaaLWWx9gS52itq++LjmHlnQ 3tUQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dp1si2402744ejc.307.2020.10.07.11.23.43; Wed, 07 Oct 2020 11:24:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727840AbgJGSIO (ORCPT + 99 others); Wed, 7 Oct 2020 14:08:14 -0400 Received: from mx2.suse.de ([195.135.220.15]:47622 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727765AbgJGSIN (ORCPT ); Wed, 7 Oct 2020 14:08:13 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id A84E7AF9C; Wed, 7 Oct 2020 18:08:11 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 07 Oct 2020 20:08:10 +0200 From: osalvador@suse.de To: Dave Hansen Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, yang.shi@linux.alibaba.com, rientjes@google.com, ying.huang@intel.com, dan.j.williams@intel.com, david@redhat.com Subject: Re: [RFC][PATCH 3/9] mm/migrate: update migration order during on hotplug events In-Reply-To: <20201007161741.DDC85648@viggo.jf.intel.com> References: <20201007161736.ACC6E387@viggo.jf.intel.com> <20201007161741.DDC85648@viggo.jf.intel.com> User-Agent: Roundcube Webmail Message-ID: <8acf3637996d5c72709a3143f41165f8@suse.de> X-Sender: osalvador@suse.de Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-10-07 18:17, Dave Hansen wrote: > From: Dave Hansen > > Reclaim-based migration is attempting to optimize data placement in > memory based on the system topology. If the system changes, so must > the migration ordering. > > The implementation here is pretty simple and entirely unoptimized. On > any memory or CPU hotplug events, assume that a node was added or > removed and recalculate all migration targets. This ensures that the > node_demotion[] array is always ready to be used in case the new > reclaim mode is enabled. > > This recalculation is far from optimal, most glaringly that it does > not even attempt to figure out if nodes are actually coming or going. > But, given the expected paucity of hotplug events, this should be > fine. Hi Dave, I am still going through all the details, but just wanted to comment early on this one. Could not you hook into __try_online_node/try_offline_node? In there we check whether a node should be brought up or removed due to lack of cpus and memory. That is being checked during hot-remove operations. We also have node_states_check_changes_{offline,online} and their pair node_states_{set,clear}_node, that checks during online/offline stages which states should be removed from the node, but that is only wrt. memory (I guess we would only be interested in N_MEMORY). Thanks