From: "Ho-Ren (Jack) Chuang" <horen.chuang@linux.dev>
To: "Jonathan Cameron" <Jonathan.Cameron@Huawei.com>,
"Huang, Ying" <ying.huang@intel.com>,
"Gregory Price" <gourry.memverge@gmail.com>,
aneesh.kumar@linux.ibm.com, mhocko@suse.com, tj@kernel.org,
john@jagalactic.com, "Eishan Mirakhur" <emirakhur@micron.com>,
"Vinicius Tavares Petrucci" <vtavarespetr@micron.com>,
"Ravis OpenSrc" <Ravis.OpenSrc@micron.com>,
"Alistair Popple" <apopple@nvidia.com>,
"Srinivasulu Thanneeru" <sthanneeru@micron.com>,
"SeongJae Park" <sj@kernel.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Len Brown <lenb@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Dave Jiang <dave.jiang@intel.com>,
Dan Williams <dan.j.williams@intel.com>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>,
"Ho-Ren (Jack) Chuang" <horen.chuang@linux.dev>,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org
Cc: "Ho-Ren (Jack) Chuang" <horenc@vt.edu>,
"Ho-Ren (Jack) Chuang" <horenchuang@bytedance.com>,
"Ho-Ren (Jack) Chuang" <horenchuang@gmail.com>,
linux-cxl@vger.kernel.org, qemu-devel@nongnu.org
Subject: [PATCH v2 0/1] memory tier: consolidate the initialization of memory tiers
Date: Fri, 28 Jun 2024 06:09:22 +0000 [thread overview]
Message-ID: <20240628060925.303309-1-horen.chuang@linux.dev> (raw)
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@huawei.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
next reply other threads:[~2024-06-28 6:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-28 6:09 Ho-Ren (Jack) Chuang [this message]
2024-06-28 6:09 ` [PATCH v2 1/1] memory tier: consolidate the initialization of memory tiers Ho-Ren (Jack) Chuang
2024-07-01 5:13 ` Huang, Ying
2024-07-02 5:37 ` Ho-Ren (Jack) Chuang
2024-07-02 13:25 ` Jonathan Cameron via
2024-07-03 8:33 ` Ho-Ren (Jack) Chuang
2024-07-04 17:08 ` Jonathan Cameron via
2024-07-03 8:51 ` Huang, Ying
2024-07-04 17:09 ` Jonathan Cameron via
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=20240628060925.303309-1-horen.chuang@linux.dev \
--to=horen.chuang@linux.dev \
--cc=Jonathan.Cameron@Huawei.com \
--cc=Ravis.OpenSrc@micron.com \
--cc=akpm@linux-foundation.org \
--cc=aneesh.kumar@linux.ibm.com \
--cc=apopple@nvidia.com \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=emirakhur@micron.com \
--cc=gourry.memverge@gmail.com \
--cc=horenc@vt.edu \
--cc=horenchuang@bytedance.com \
--cc=horenchuang@gmail.com \
--cc=john@jagalactic.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=qemu-devel@nongnu.org \
--cc=rafael@kernel.org \
--cc=sj@kernel.org \
--cc=sthanneeru@micron.com \
--cc=tj@kernel.org \
--cc=vtavarespetr@micron.com \
--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;
as well as URLs for NNTP newsgroup(s).