[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240628060925.303309-1-horen.chuang@linux.dev>
Date: Fri, 28 Jun 2024 06:09:22 +0000
From: "Ho-Ren (Jack) Chuang" <horen.chuang@...ux.dev>
To: "Jonathan Cameron" <Jonathan.Cameron@...wei.com>,
"Huang, Ying" <ying.huang@...el.com>,
"Gregory Price" <gourry.memverge@...il.com>,
aneesh.kumar@...ux.ibm.com,
mhocko@...e.com,
tj@...nel.org,
john@...alactic.com,
"Eishan Mirakhur" <emirakhur@...ron.com>,
"Vinicius Tavares Petrucci" <vtavarespetr@...ron.com>,
"Ravis OpenSrc" <Ravis.OpenSrc@...ron.com>,
"Alistair Popple" <apopple@...dia.com>,
"Srinivasulu Thanneeru" <sthanneeru@...ron.com>,
"SeongJae Park" <sj@...nel.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Len Brown <lenb@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Dave Jiang <dave.jiang@...el.com>,
Dan Williams <dan.j.williams@...el.com>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>,
"Ho-Ren (Jack) Chuang" <horen.chuang@...ux.dev>,
linux-acpi@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-mm@...ck.org
Cc: "Ho-Ren (Jack) Chuang" <horenc@...edu>,
"Ho-Ren (Jack) Chuang" <horenchuang@...edance.com>,
"Ho-Ren (Jack) Chuang" <horenchuang@...il.com>,
linux-cxl@...r.kernel.org,
qemu-devel@...gnu.org
Subject: [PATCH v2 0/1] memory tier: consolidate the initialization of memory tiers
The current memory tier initialization process is distributed across
two different functions, memory_tier_init() and memory_tier_late_init().
This design is hard to maintain. Thus, this patch is proposed to reduce
the possible code paths by consolidating different
initialization patches into one.
The earlier discussion with Jonathan and Ying is listed here:
https://lore.kernel.org/lkml/20240405150244.00004b49@Huawei.com/
If we want to put these two initializations together, they must be
placed together in the later function. Because only at that time,
the HMAT information will be ready, adist between nodes can be
calculated, and memory tiering can be established based on the adist.
So we position the initialization at memory_tier_init() to the
memory_tier_late_init() call.
Moreover, it's natural to keep memory_tier initialization in drivers at
device_initcall() level.
- v2:
Thanks to Huang, Ying's and Andrew's comments
* Add cover letter
* Add Suggested-by: Jonathan Cameron <Jonathan.Cameron@...wei.com>
* Add get/put_online_mems() protection in memory_tier_late_init()
* If memtype is set, skip initializing its node
* Remove redundant code/comments or rewrite code in a cleaner manner
- v1:
* https://lore.kernel.org/all/20240621044833.3953055-1-horen.chuang@linux.dev/
This patchset is based on commits cf93be18fa1b and a72a30af550c:
[0/2] https://lkml.kernel.org/r/20240405000707.2670063-1-horenchuang@bytedance.com
[1/2] https://lkml.kernel.org/r/20240405000707.2670063-2-horenchuang@bytedance.com
[1/2] https://lkml.kernel.org/r/20240405000707.2670063-3-horenchuang@bytedance.com
Ho-Ren (Jack) Chuang (1):
memory tier: consolidate the initialization of memory tiers
drivers/acpi/numa/hmat.c | 5 +--
include/linux/memory-tiers.h | 2 ++
mm/memory-tiers.c | 59 +++++++++++++++---------------------
3 files changed, 28 insertions(+), 38 deletions(-)
--
Ho-Ren (Jack) Chuang
Powered by blists - more mailing lists