public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: "Chen, Yu C" <yu.c.chen@intel.com>,
	"Liu, Yuan1" <yuan1.liu@intel.com>,
	Mike Rapoport <rppt@kernel.org>
Cc: Oscar Salvador <osalvador@suse.de>,
	Wei Yang <richard.weiyang@gmail.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"Hu, Yong" <yong.hu@intel.com>,
	"Zou, Nanhai" <nanhai.zou@intel.com>,
	Tim Chen <tim.c.chen@linux.intel.com>,
	"Zhuo, Qiuxu" <qiuxu.zhuo@intel.com>,
	"Deng, Pan" <pan.deng@intel.com>,
	"Li, Tianyou" <tianyou.li@intel.com>,
	Chen Zhang <zhangchen.kidd@jd.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm/memory hotplug/unplug: Optimize zone contiguous check when changing pfn range
Date: Thu, 26 Mar 2026 10:53:49 +0100	[thread overview]
Message-ID: <72934683-0409-4e6a-9d34-daabade131eb@kernel.org> (raw)
In-Reply-To: <cc8ee2c6-a169-4cb1-9c16-e76ae08fcc58@intel.com>

On 3/26/26 08:38, Chen, Yu C wrote:
> On 3/26/2026 3:30 PM, Liu, Yuan1 wrote:
>>> -----Original Message-----
> 
> [ .... ]
> 
>>
>> Btw, can we introduce a new kernel command-line parameter to allow
>> users to select
>> the memory block size? This could also address the current issue.
>>
>> Test Results as below, memory block size 128MB Vs. 2GB
>> +----------------+------+---------------+--------------+----------------+
>> |                | Size |    128MG      |    2GB       | Time Reduction |
>> |                +------+---------------+--------------+----------------+
>> | Plug Memory    | 256G |      10s      |       3s     |       70%      |
>> |                +------+---------------+--------------+----------------+
>> |                | 512G |      36s      |       7s     |       81%      |
>> +----------------+------+---------------+--------------+----------------+
>>   +----------------+------+---------------+--------------
>> +----------------+
>> |                | Size |    128MG      |    2GB       | Time Reduction |
>> |                +------+---------------+--------------+----------------+
>> | Unplug Memory  | 256G |      11s      |      3s      |       72%      |
>> |                +------+---------------+--------------+----------------+
>> |                | 512G |      36s      |      7s      |       81%      |
>> +----------------+------+---------------+--------------+----------------+
>>
>> And I see the UV system has already this (Kernel parameter is
>> uv_memblksize).
>> I think if we can introduce a common kernel parameter for memory block
>> size configuration?
>>
> 
> Is it possible to turn uv_memblksize into a generic commandline
> memblksize without
> introducing extra parameter?

We don't want that, and it's kind of a workaround for the problem. :)

I think we would want to only account pages towards
pages_with_online_memmap that fall within the zone span.

We will not account pages initialized that are outside the zone span.

Growing the zone and later trying to shrink them will only possibly see
a "too small"  pages_with_online_memmap value. That is fine, it simply
prevents detecting "contiguous" so it's safe.

We can document that, and in the future we could handle it a bit nicer
(e.g., indicate these pages as being just fill material).

So indeed, I guess we want to teach init_unavailable_range() to only
account towards zone->pages_with_online_memmap whatever falls into the
zone span.

That could be done internally, or from the callers by calling
init_unavailable_range() once for the out-of-zone range and once for the
in-zone-range.

-- 
Cheers,

David


  reply	other threads:[~2026-03-26  9:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-19  9:56 [PATCH] mm/memory hotplug/unplug: Optimize zone contiguous check when changing pfn range Yuan Liu
2026-03-19 10:08 ` Liu, Yuan1
2026-03-20  3:13 ` Andrew Morton
2026-03-23 10:56 ` David Hildenbrand (Arm)
2026-03-23 11:31   ` Mike Rapoport
2026-03-23 11:42     ` David Hildenbrand (Arm)
2026-03-26  7:30       ` Liu, Yuan1
2026-03-26  7:38         ` Chen, Yu C
2026-03-26  9:53           ` David Hildenbrand (Arm) [this message]
2026-03-27  7:47             ` Liu, Yuan1
2026-03-26  3:39   ` Liu, Yuan1
2026-03-26  9:23     ` David Hildenbrand (Arm)
2026-03-27  7:39       ` Liu, Yuan1
2026-03-23 11:51 ` Mike Rapoport
2026-03-26  7:32   ` Liu, Yuan1

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=72934683-0409-4e6a-9d34-daabade131eb@kernel.org \
    --to=david@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nanhai.zou@intel.com \
    --cc=osalvador@suse.de \
    --cc=pan.deng@intel.com \
    --cc=qiuxu.zhuo@intel.com \
    --cc=richard.weiyang@gmail.com \
    --cc=rppt@kernel.org \
    --cc=tianyou.li@intel.com \
    --cc=tim.c.chen@linux.intel.com \
    --cc=yong.hu@intel.com \
    --cc=yu.c.chen@intel.com \
    --cc=yuan1.liu@intel.com \
    --cc=zhangchen.kidd@jd.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