linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Baolin Wang <baolin.wang@linux.alibaba.com>
To: "Huang, Ying" <ying.huang@intel.com>
Cc: akpm@linux-foundation.org, dave.hansen@linux.intel.com,
	ziy@nvidia.com, osalvador@suse.de, shy828301@gmail.com,
	zhongjiang-ali@linux.alibaba.com, xlpang@linux.alibaba.com,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] mm: migrate: Support multiple target nodes demotion
Date: Fri, 12 Nov 2021 11:10:13 +0800	[thread overview]
Message-ID: <7f212c43-519a-ddcc-5cba-d23c487af321@linux.alibaba.com> (raw)
In-Reply-To: <87tugikre3.fsf@yhuang6-desk2.ccr.corp.intel.com>



On 2021/11/12 11:02, Huang, Ying wrote:
> Baolin Wang <baolin.wang@linux.alibaba.com> writes:
> 
>> On 2021/11/12 10:44, Huang, Ying wrote:
>>> Baolin Wang <baolin.wang@linux.alibaba.com> writes:
>>>
>>>> We have some machines with multiple memory types like below, which
>>>> have one fast (DRAM) memory node and two slow (persistent memory) memory
>>>> nodes. According to current node demotion policy, if node 0 fills up,
>>>> its memory should be migrated to node 1, when node 1 fills up, its
>>>> memory will be migrated to node 2: node 0 -> node 1 -> node 2 ->stop.
>>>>
>>>> But this is not efficient and suitbale memory migration route
>>>> for our machine with multiple slow memory nodes. Since the distance
>>>> between node 0 to node 1 and node 0 to node 2 is equal, and memory
>>>> migration between slow memory nodes will increase persistent memory
>>>> bandwidth greatly, which will hurt the whole system's performance.
>>>>
>>>> Thus for this case, we can treat the slow memory node 1 and node 2
>>>> as a whole slow memory region, and we should migrate memory from
>>>> node 0 to node 1 and node 2 if node 0 fills up.
>>>>
>>>> This patch changes the node_demotion data structure to support multiple
>>>> target nodes, and establishes the migration path to support multiple
>>>> target nodes with validating if the node distance is the best or not.
>>>>
>>>> available: 3 nodes (0-2)
>>>> node 0 cpus: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
>>>> node 0 size: 62153 MB
>>>> node 0 free: 55135 MB
>>>> node 1 cpus:
>>>> node 1 size: 127007 MB
>>>> node 1 free: 126930 MB
>>>> node 2 cpus:
>>>> node 2 size: 126968 MB
>>>> node 2 free: 126878 MB
>>>> node distances:
>>>> node   0   1   2
>>>>     0:  10  20  20
>>>>     1:  20  10  20
>>>>     2:  20  20  10
>>>>
>>>> Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
>>
>> snip
>>
>>>>    	/*
>>>>    	 * 'next_pass' contains nodes which became migration
>>>> @@ -3192,6 +3281,14 @@ static int __init migrate_on_reclaim_init(void)
>>>>    {
>>>>    	int ret;
>>>>    +	/*
>>>> +	 * Ignore allocation failure, if this kmalloc fails
>>>> +	 * at boot time, we are likely in bigger trouble.
>>>> +	 */
>>>> +	node_demotion = kmalloc_array(nr_node_ids,
>>>> +				      sizeof(struct demotion_nodes),
>>>> +				      GFP_KERNEL);
>>>> +
>>> I think we should WARN_ON() here.
>>
>> In this unlikey case, I think the mm core will print more information,
>> IMHO WARN_ON() will help little. Anyway no strong opinion on
>> this. Other than that, can I get your reviewed-by tag with this nit
>> fixed? Thanks.
> 
> Yes.  Please add my "reviewed-by" after changing this.

OK. Thanks for your reviewing.


  reply	other threads:[~2021-11-12  3:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-12  2:27 Baolin Wang
2021-11-12  2:44 ` Huang, Ying
2021-11-12  2:58   ` Baolin Wang
2021-11-12  3:02     ` Huang, Ying
2021-11-12  3:10       ` Baolin Wang [this message]
2021-11-12 19:05 ` Yang Shi
2021-11-14 14:40   ` Baolin Wang
2021-11-15 19:06     ` Yang Shi
2021-11-16  2:58       ` Baolin Wang

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=7f212c43-519a-ddcc-5cba-d23c487af321@linux.alibaba.com \
    --to=baolin.wang@linux.alibaba.com \
    --cc=akpm@linux-foundation.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=osalvador@suse.de \
    --cc=shy828301@gmail.com \
    --cc=xlpang@linux.alibaba.com \
    --cc=ying.huang@intel.com \
    --cc=zhongjiang-ali@linux.alibaba.com \
    --cc=ziy@nvidia.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