Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2810324pxp; Mon, 14 Mar 2022 05:32:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7OlQmkmBBRa9kWyWLyfI2iRbWICJg0w5dAPUsVNCdKZkrsJG0xiTaoECt4oESQhmHKOCo X-Received: by 2002:a17:906:74c3:b0:6da:be6d:d64b with SMTP id z3-20020a17090674c300b006dabe6dd64bmr18731798ejl.695.1647261179049; Mon, 14 Mar 2022 05:32:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647261179; cv=none; d=google.com; s=arc-20160816; b=fWLvGH6wU+WW027xWRmR07nOAd3b9BUqQ4tvTWqtXsYGrLqBjYQqnUtOelVR3/Dlm1 bZ5NZJQgOhruh5TVfpHeR9BN0vAFqaZq9X14Pq+5NgU8hbU3k1h9oAlBIe8rakFPjlWw wOg8L2YC4BFokXIxl1YPXpjWYx3tVBF4UyNS0AoI8YwK45Hu36L5HntcM3bLx2kwtjd/ /t6PiFSzpbVc2qpppYY8EezXw4y3bqL6QuIeLeZY4vm2w8HabaXHMuSD0rAXXVehCdoH RF8ONVNpHvAqQ9rrQ0inXUnN6jAXURwHxj6+8ppbpJlsLg13efEDHsMb6YAkxSxb/hxL unDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=++A1Zo/SgLYfjcOIx9iTECP0dGd1BmEhWIQpT5Q3bpQ=; b=R+RDnr8Hgz0173ZaeKA4Iw5SxjVJDaFKP7Y1ZOv9Ng5794Ko5RglD3eAPB1EAAfnpP fi+hRbH7VWOB8CSRD27Nc4ub2DdJLIHq816XAzK9pcWPCe6teL+oYodmhv93vOXHVEAE cYOFWfn3vsSwVk3G/D7w7w9GVEq0fl7yy/4j+CI6A2DXe8PxiNhHh5/BHPhqP39Nzzjj 6FAUvlbbXNOfOuRCB7Ve0YtCa8Mf/d7a6PNbiCyT42WtX+WUYX+EJdsygqYArTWQ4zk5 M0T0OCy4ChdJ5EEiiUIx0eg3B9HfaDKiCh4O2SZNb63NEWS+GGQj6dJqD4M4vu/RSEIn JPhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gxJRtZN0; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x4-20020aa7d6c4000000b00416be763e27si7376164edr.124.2022.03.14.05.32.32; Mon, 14 Mar 2022 05:32:59 -0700 (PDT) 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=@intel.com header.s=Intel header.b=gxJRtZN0; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233320AbiCNBFP (ORCPT + 99 others); Sun, 13 Mar 2022 21:05:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229831AbiCNBFN (ORCPT ); Sun, 13 Mar 2022 21:05:13 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5481D46659 for ; Sun, 13 Mar 2022 18:04:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1647219844; x=1678755844; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version; bh=ySgDxotKJSJVAy+FBzbr2z38YaeYDTtZKQwAu4elqtM=; b=gxJRtZN0thWYqoh+nt9gxQ8BhWhSczQYxmFxekB+c2nxIpfvwiUn4lQa 0r8lEg9e+DxXTB8MbHpGPsj0cZXKEQmLq9u8DYpsVJvZlUc8wIP1FYoE/ cXETyGV6pu07HOqI98PG24xkb//e9k3V6mM+uYb+Gv4p8rx5hBSQ8kr+m BMQplBHUgTTf/i5xFT8eskRvyPEPnyVh1NmVglkPHGsrjSyoVCdEuls0K J9OGTYD4fDFAqFq0K0UzkwMXs9doKFpJIXH8CwcV0Uxramn+6z2DlpU7+ AVWj7xiy6WvcjkmJVOWpW5LLT5jK8TXkSqPsqgPuMO9ruWC4EPALZRX2s Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10285"; a="235859180" X-IronPort-AV: E=Sophos;i="5.90,179,1643702400"; d="scan'208";a="235859180" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Mar 2022 18:04:04 -0700 X-IronPort-AV: E=Sophos;i="5.90,179,1643702400"; d="scan'208";a="556160523" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.239.13.94]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Mar 2022 18:04:01 -0700 From: "Huang, Ying" To: Oscar Salvador Cc: Andrew Morton , Dave Hansen , 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 References: <20220310120749.23077-1-osalvador@suse.de> <87mthxb514.fsf@yhuang6-desk2.ccr.corp.intel.com> Date: Mon, 14 Mar 2022 09:03:59 +0800 In-Reply-To: (Oscar Salvador's message of "Fri, 11 Mar 2022 09:39:52 +0100") Message-ID: <87czip73b4.fsf@yhuang6-desk2.ccr.corp.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_NONE,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 Oscar Salvador writes: > On Fri, Mar 11, 2022 at 10:24:07AM +0800, Huang, Ying wrote: >> It may be unnecessary to be fixed in this patch. But I think we need to >> cleanup the kernel config dependencies of the demotion code at some time. > > I am glad you brought this up because it is something I have been > thinking about. > I already added it in my to-do list, but I would do it in a separate > patch if you do not mind. Thanks! > Now, let us try to untangle this mess: > >> 1. Even if !defined(CONFIG_HOTPLUG_CPU) && >> !defined(CONFIG_MEMORY_HOTPLUG), we still need to allocate >> "node_demotion" and call set_migration_target_nodes() during boot time. >> >> 2. If !defined(CONFIG_MEMORY_HOTPLUG), we don't need >> migrate_on_reclaim_callback(). >> >> 3. We need defined(CONFIG_NUMA) && defined(CONFIG_MIGRATION) for all >> these code. > > Back in the early versions [1] I asked whether we could have some > scenario where this feature could be used when !CONFIG_MEMORY_HOTPLUG > [2]. > The reason I was given is that in order to bind the expose PMEM memory > as RAM (add_memory_driver_managed()), we need MEMORY_HOTPLUG. > > Now, as I said back then, I am not sure whether PMEM memory can be > exposed as RAM by other means, but as it was pointed out back then, > it really looks like we, at least, need CONFIG_MEMORY_HOTPLUG. > > Ok, so we have our first dependency: CONFIG_MEMORY_HOTPLUG. On host machine, PMEM is always exposed via memory hotplug. But later on, we found that for guest system it's possible for PMEM to be exposed as normal memory. Best Regards, Huang, Ying > Now, about CONFIG_HOTPLUG_CPU, it seems that that is not a strong dependency, > as we do not need cpu-hotplug in order to use the feature. > > We definitely need CONFIG_MIGRATION and CONFIG_NUMA though. > > So, we have something like: > > - Depends: > * CONFIG_NUMA (obvius) > * CONFIG_MIGRATION (to migrate between nodes) > * CONFIG_MEMORY_HOTPLUG (to expose PMEM as RAM) > > Sounds about right? > > [1] https://patchwork.kernel.org/project/linux-mm/patch/20210401183221.977831DE@viggo.jf.intel.com/#24099405 > [2] https://patchwork.kernel.org/project/linux-mm/patch/20210401183221.977831DE@viggo.jf.intel.com/#24103467