qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/1] memory tier: consolidate the initialization of memory tiers
@ 2024-06-28  6:09 Ho-Ren (Jack) Chuang
  2024-06-28  6:09 ` [PATCH v2 1/1] " Ho-Ren (Jack) Chuang
  0 siblings, 1 reply; 9+ messages in thread
From: Ho-Ren (Jack) Chuang @ 2024-06-28  6:09 UTC (permalink / raw)
  To: Jonathan Cameron, Huang, Ying, Gregory Price, aneesh.kumar,
	mhocko, tj, john, Eishan Mirakhur, Vinicius Tavares Petrucci,
	Ravis OpenSrc, Alistair Popple, Srinivasulu Thanneeru,
	SeongJae Park, Rafael J. Wysocki, Len Brown, Andrew Morton,
	Dave Jiang, Dan Williams, Jonathan Cameron, Ho-Ren (Jack) Chuang,
	linux-acpi, linux-kernel, linux-mm
  Cc: Ho-Ren (Jack) Chuang, Ho-Ren (Jack) Chuang, Ho-Ren (Jack) Chuang,
	linux-cxl, qemu-devel

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



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-07-04 17:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-28  6:09 [PATCH v2 0/1] memory tier: consolidate the initialization of memory tiers Ho-Ren (Jack) Chuang
2024-06-28  6:09 ` [PATCH v2 1/1] " 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

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).