Re: [PATCH v3 1/3] mm: memory-tiers, numa_emu: enable to create memory tiers using fake numa nodes
From: Akinobu Mita
Date: Fri Jan 09 2026 - 22:47:36 EST
2026年1月9日(金) 0:47 Jonathan Cameron <jonathan.cameron@xxxxxxxxxx>:
>
> On Thu, 8 Jan 2026 19:15:33 +0900
> Akinobu Mita <akinobu.mita@xxxxxxxxx> wrote:
>
> > This makes it possible to create memory tiers using fake numa nodes
> > generated by numa emulation.
> >
> > The "numa_emulation.adistance=" kernel cmdline option allows you to set
> > the abstract distance for each NUMA node.
> >
> > For example, you can create two fake nodes, each in a different memory
> > tier by booting with "numa=fake=2 numa_emulation.adistance=576,704".
> > Here, the abstract distances of node0 and node1 are set to 576 and 706,
> > respectively.
> >
> > Each memory tier covers an abstract distance chunk size of 128. Thus,
> > nodes with abstract distances between 512 and 639 are classified into the
> > same memory tier, and nodes with abstract distances between 640 and 767
> > are classified into the next slower memory tier.
> >
> > The abstract distance of fake nodes not specified in the parameter will
> > be the default DRAM abstract distance of 576.
> >
> > Signed-off-by: Akinobu Mita <akinobu.mita@xxxxxxxxx>
> > ---
> > v2:
> > - fix the explanation about cmdline parameter in the commit log
> A couple of comments on includes, with those resolved LGTM.
> Reviewed-by: Jonathan Cameron <jonathan.cameron@xxxxxxxxxx>
>
> >
> > mm/numa_emulation.c | 26 ++++++++++++++++++++++++++
> > 1 file changed, 26 insertions(+)
> >
> > diff --git a/mm/numa_emulation.c b/mm/numa_emulation.c
> > index 703c8fa05048..a4266da21344 100644
> > --- a/mm/numa_emulation.c
> > +++ b/mm/numa_emulation.c
> > @@ -6,6 +6,9 @@
> > #include <linux/errno.h>
> > #include <linux/topology.h>
> > #include <linux/memblock.h>
> > +#include <linux/memory-tiers.h>
> > +#include <linux/module.h>
> > +#include <linux/node.h>
>
> I can't immediately spot why the new code needs node.h
The first version used the access_coordinate struct, but that is no longer
used, so including linux/node.h is no longer necessary.
>
> Should also include
> linux/notifier.h for the notifier_block definition.
I will fix these includes in the next version.