From: horen.chuang@linux.dev
To: "Andrew Morton" <akpm@linux-foundation.org>
Cc: "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>,
"Dave Jiang" <dave.jiang@intel.com>,
"Dan Williams" <dan.j.williams@intel.com>,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, "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: Re: [PATCH v1] memory tier: consolidate the initialization of memory tiers
Date: Tue, 25 Jun 2024 06:24:11 +0000 [thread overview]
Message-ID: <acf41fe2246f3696a6fe267b8a23bdb4f855cb4e@linux.dev> (raw)
In-Reply-To: <20240621183413.1638e7453a0bed2af5f44273@linux-foundation.org>
June 21, 2024 at 6:34 PM, "Andrew Morton" <akpm@linux-foundation.org> wrote:
Hi Andrew,
Thanks for the feedback. I will send a v2 with the patch description
written in a cover letter.
>
> On Fri, 21 Jun 2024 04:48:30 +0000 "Ho-Ren (Jack) Chuang" <horen.chuang@linux.dev> wrote:
>
> >
> > If we simply move the set_node_memory_tier() from memory_tier_init() to
> >
> > late_initcall(), it will result in HMAT not registering the
> >
> > mt_adistance_algorithm callback function,
> >
>
> Immediate reaction: then don't do that!
>
> >
> > because set_node_memory_tier()
> >
> > is not performed during the memory tiering initialization phase,
> >
> > leading to a lack of correct default_dram information.
> >
> >
> >
> > Therefore, we introduced a nodemask to pass the information of the
> >
> > default DRAM nodes. The reason for not choosing to reuse
> >
> > default_dram_type->nodes is that it is not clean enough. So in the end,
> >
> > we use a __initdata variable, which is a variable that is released once
> >
> > initialization is complete, including both CPU and memory nodes for HMAT
> >
> > to iterate through.
> >
> >
> >
> > Besides, since default_dram_type may be checked/used during the
> >
> > initialization process of HMAT and drivers, it is better to keep the
> >
> > allocation of default_dram_type in memory_tier_init().
> >
>
> What is this patch actually aiming to do? Is it merely a code cleanup,
>
> or are there functional changes?
>
> >
> > Signed-off-by: Ho-Ren (Jack) Chuang <horenchuang@bytedance.com>
> >
> > ---
> >
> > Hi all,
> >
> >
> >
> > 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.
> >
>
> Ah, there it is. Please make this the opening paragraph, not an aside
>
> buried below the ^---$.
>
> I'll await review input before proceeding with this, thanks.
>
next prev parent reply other threads:[~2024-06-25 6:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-21 4:48 [PATCH v1] memory tier: consolidate the initialization of memory tiers Ho-Ren (Jack) Chuang
2024-06-22 1:34 ` Andrew Morton
2024-06-25 6:24 ` horen.chuang [this message]
2024-06-24 8:27 ` Huang, Ying
2024-06-25 7:22 ` Ho-Ren Chuang
2024-06-25 8:46 ` Huang, Ying
2024-06-27 4:17 ` Ho-Ren Chuang
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=acf41fe2246f3696a6fe267b8a23bdb4f855cb4e@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).