From: Baolin Wang <baolin.wang@linux.alibaba.com>
To: Oscar Salvador <osalvador@suse.de>, "Huang, Ying" <ying.huang@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Dave Hansen <dave.hansen@linux.intel.com>,
Abhishek Goel <huntbag@linux.vnet.ibm.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: Only re-generate demotion targets when a numa node changes its N_CPU state
Date: Thu, 10 Mar 2022 14:24:38 +0800 [thread overview]
Message-ID: <be249da5-1f10-165a-02a4-a2342cd18692@linux.alibaba.com> (raw)
In-Reply-To: <YimRJS9XFE8nswkd@localhost.localdomain>
Hi Oscar,
On 3/10/2022 1:48 PM, Oscar Salvador wrote:
> On Thu, Mar 10, 2022 at 08:39:53AM +0800, Huang, Ying wrote:
>> We need to call set_migration_target_nodes() during system boot
>> somewhere, either here or in init_mm_internals().
>
> Hi Huang Ying,
>
> vmstat_cpu_online() already gets called during boot:
>
> static struct cpuhp_step cpuhp_hp_states[] = {
> ...
> #ifdef CONFIG_SMP
> [CPUHP_CREATE_THREADS]= {
> .name = "threads:prepare",
> .startup.single = smpboot_create_threads,
> .teardown.single = NULL,
> .cant_stop = true,
> },
> ...
>
> smpboot_create_threads
> __smpboot_create_thread
> smpboot_thread_fn
> ht->thread_fn()
> cpuhp_thread_fun
> cpuhp_invoke_callback
> vmstat_cpu_online
>
> That for every CPU that is brought up during boot.
>
> So unless I am missing something, I would say we are already covered
> there, right?
I've tested your patch, unfortunately it can not work. It already set
the node with N_CPU state in init_cpu_node_state() earlier, so in
vmstat_cpu_online() ,the sentence 'if(!node_state(cpu_to_node(cpu),
N_CPU))' is always false, which means it will not call
set_migration_target_nodes().
Like Huang Ying said, we should call set_migration_target_nodes() in
migrate_on_reclaim_init() or init_mm_internals().
next prev parent reply other threads:[~2022-03-10 6:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-09 14:46 Oscar Salvador
2022-03-09 21:02 ` Andrew Morton
2022-03-09 21:55 ` Oscar Salvador
2022-03-10 0:39 ` Huang, Ying
2022-03-10 5:48 ` Oscar Salvador
2022-03-10 6:24 ` Baolin Wang [this message]
2022-03-10 0:56 ` kernel test robot
2022-03-10 1:17 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=be249da5-1f10-165a-02a4-a2342cd18692@linux.alibaba.com \
--to=baolin.wang@linux.alibaba.com \
--cc=akpm@linux-foundation.org \
--cc=dave.hansen@linux.intel.com \
--cc=huntbag@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=osalvador@suse.de \
--cc=ying.huang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox