linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Liu, Yuan1" <yuan1.liu@intel.com>
To: "David Hildenbrand (Arm)" <david@kernel.org>,
	"Chen, Yu C" <yu.c.chen@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: Fri, 27 Mar 2026 07:47:27 +0000	[thread overview]
Message-ID: <IA4PR11MB9009D72746B910E2FC3632D7A357A@IA4PR11MB9009.namprd11.prod.outlook.com> (raw)
In-Reply-To: <72934683-0409-4e6a-9d34-daabade131eb@kernel.org>


> -----Original Message-----
> From: David Hildenbrand (Arm) <david@kernel.org>
> Sent: Thursday, March 26, 2026 5:54 PM
> 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; 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
> Subject: Re: [PATCH] mm/memory hotplug/unplug: Optimize zone contiguous
> check when changing pfn range
> 
> 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.

This looks like a clear approach, I will implement it in the next version.

> --
> Cheers,
> 
> David

  reply	other threads:[~2026-03-27  7:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-19  9:56 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)
2026-03-27  7:47             ` Liu, Yuan1 [this message]
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
     [not found] ` <CGME20260409023553epcas2p2e40d1d79206f0169a765fadcf180b010@epcas2p2.samsung.com>
2026-04-09  2:35   ` Sion Ji
2026-04-09  3:20     ` 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=IA4PR11MB9009D72746B910E2FC3632D7A357A@IA4PR11MB9009.namprd11.prod.outlook.com \
    --to=yuan1.liu@intel.com \
    --cc=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=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