[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <acf41fe2246f3696a6fe267b8a23bdb4f855cb4e@linux.dev>
Date: Tue, 25 Jun 2024 06:24:11 +0000
From: horen.chuang@...ux.dev
To: "Andrew Morton" <akpm@...ux-foundation.org>
Cc: "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>, "Dave Jiang" <dave.jiang@...el.com>, "Dan Williams"
<dan.j.williams@...el.com>, linux-acpi@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org, "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: Re: [PATCH v1] memory tier: consolidate the initialization of memory
tiers
June 21, 2024 at 6:34 PM, "Andrew Morton" <akpm@...ux-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@...ux.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@...edance.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.
>
Powered by blists - more mailing lists