On Wed, Aug 7, 2024, at 08:41, Mike Rapoport wrote:
> From: "Mike Rapoport (Microsoft)"
>
> Until now arch_numa was directly translating firmware NUMA information
> to memblock.
I get a link time warning from this:
WARNING: modpost: vmlinux: section mismatch in reference:
numa_set_cpumask+0
From: "Mike Rapoport (Microsoft)"
NUMA emulation can be now enabled on arm64 and riscv in addition to x86.
Move description of numa=fake parameters from x86 documentation of
admin-guide/kernel-parameters.txt
Suggested-by: Zi Yan
Signed-off-by: Mike Rapoport (Microsoft)
Reviewed-by: Jonathan C
From: "Mike Rapoport (Microsoft)"
The x86 implementation of range-to-target_node lookup (i.e.
phys_to_target_node() and memory_add_physaddr_to_nid()) relies on
numa_memblks.
Since numa_memblks are now part of the generic code, move these
functions from x86 to mm/numa_memblks.c and select
CONFIG_
From: "Mike Rapoport (Microsoft)"
Until now arch_numa was directly translating firmware NUMA information
to memblock.
Using numa_memblks as an intermediate step has a few advantages:
* alignment with more battle tested x86 implementation
* availability of NUMA emulation
* maintaining node inform
From: "Mike Rapoport (Microsoft)"
Currently of_numa_parse_memory_nodes() returns 0 if no "memory" node in
device tree contains "numa-node-id" property. This makes of_numa_init()
to return "success" despite no NUMA nodes were actually parsed and set
up.
arch_numa workarounds this by returning an
From: "Mike Rapoport (Microsoft)"
numa_cleanup_meminfo() moves blocks outside system RAM to
numa_reserved_meminfo and it uses 0 and PFN_PHYS(max_pfn) to determine
the memory boundaries.
Replace the memory range boundaries with more portable
memblock_start_of_DRAM() and memblock_end_of_DRAM().
S
From: "Mike Rapoport (Microsoft)"
Make functions and variables that are exclusively used by numa_memblks
static.
Move numa_nodemask_from_meminfo() before its callers to avoid forward
declaration.
Signed-off-by: Mike Rapoport (Microsoft)
Tested-by: Zi Yan # for x86_64 and arm64
Reviewed-by: Jo
From: "Mike Rapoport (Microsoft)"
Move most of x86::numa_init() to numa_memblks so that the latter will be
more self-contained.
With this numa_memblk data structures should not be exposed to the
architecture specific code.
Signed-off-by: Mike Rapoport (Microsoft)
Tested-by: Zi Yan # for x86_6
From: "Mike Rapoport (Microsoft)"
Move numa_emulation code from arch/x86 to mm/numa_emulation.c
This code will be later reused by arch_numa.
No functional changes.
Signed-off-by: Mike Rapoport (Microsoft)
Tested-by: Zi Yan # for x86_64 and arm64
Reviewed-by: Jonathan Cameron
Tested-by: Jona
From: "Mike Rapoport (Microsoft)"
Move code dealing with numa_distance array from arch/x86 to
mm/numa_memblks.c
This code will be later reused by arch_numa.
No functional changes.
Signed-off-by: Mike Rapoport (Microsoft)
Tested-by: Zi Yan # for x86_64 and arm64
Reviewed-by: Jonathan Cameron
From: "Mike Rapoport (Microsoft)"
Move code dealing with numa_memblks from arch/x86 to mm/ and add Kconfig
options to let x86 select it in its Kconfig.
This code will be later reused by arch_numa.
No functional changes.
Signed-off-by: Mike Rapoport (Microsoft)
Tested-by: Zi Yan # for x86_64
From: "Mike Rapoport (Microsoft)"
CPU id cannot be negative.
Making it unsigned also aligns with declarations in
include/asm-generic/numa.h used by arm64 and riscv and allows sharing
numa emulation code with these architectures.
Signed-off-by: Mike Rapoport (Microsoft)
Reviewed-by: Jonathan Ca
From: "Mike Rapoport (Microsoft)"
This is required to make numa emulation code architecture independent so
that it can be moved to generic code in following commits.
Signed-off-by: Mike Rapoport (Microsoft)
Reviewed-by: Jonathan Cameron
Tested-by: Zi Yan # for x86_64 and arm64
Tested-by: Jona
From: "Mike Rapoport (Microsoft)"
This is required to make numa emulation code architecture independent so
that it can be moved to generic code in following commits.
Signed-off-by: Mike Rapoport (Microsoft)
Reviewed-by: Jonathan Cameron
Tested-by: Zi Yan # for x86_64 and arm64
Tested-by: Jona
From: "Mike Rapoport (Microsoft)"
By the time numa_emulation() is called, all physical memory is already
mapped in the direct map and there is no need to define limits for
memblock allocation.
Replace memblock_phys_alloc_range() with memblock_alloc().
Signed-off-by: Mike Rapoport (Microsoft)
R
From: "Mike Rapoport (Microsoft)"
The definitions of FAKE_NODE_MIN_SIZE and FAKE_NODE_MIN_HASH_MASK are
only used by numa emulation code, make them local to
arch/x86/mm/numa_emulation.c
Signed-off-by: Mike Rapoport (Microsoft)
Reviewed-by: Jonathan Cameron
Tested-by: Zi Yan # for x86_64 and a
From: "Mike Rapoport (Microsoft)"
Instead of looping over numa_meminfo array to detect node's start and
end addresses use get_pfn_range_for_init().
This is shorter and make it easier to lift numa_memblks to generic code.
Signed-off-by: Mike Rapoport (Microsoft)
Tested-by: Zi Yan # for x86_64
From: "Mike Rapoport (Microsoft)"
Allocation of numa_distance uses memblock_phys_alloc_range() to limit
allocation to be below the last mapped page.
But NUMA initializaition runs after the direct map is populated and
there is also code in setup_arch() that adjusts memblock limit to
reflect how m
From: "Mike Rapoport (Microsoft)"
Architectures that support NUMA duplicate the code that allocates
NODE_DATA on the node-local memory with slight variations in reporting
of the addresses where the memory was allocated.
Use x86 version as the basis for the generic alloc_node_data() function
and
From: "Mike Rapoport (Microsoft)"
There are no users of HAVE_ARCH_NODEDATA_EXTENSION left, so
arch_alloc_nodedata() and arch_refresh_nodedata() are not needed
anymore.
Replace the call to arch_alloc_nodedata() in free_area_init() with a
new helper alloc_offline_node_data(), remove arch_refresh_n
From: "Mike Rapoport (Microsoft)"
Every architecture that supports NUMA defines node_data in the same way:
struct pglist_data *node_data[MAX_NUMNODES];
No reason to keep multiple copies of this definition and its forward
declarations, especially when such forward declaration is the only
From: "Mike Rapoport (Microsoft)"
Commit f8f9f21c7848 ("MIPS: Fix build error for loongson64 and
sgi-ip27") added HAVE_ARCH_NODEDATA_EXTENSION to loongson64 to silence a
compilation error that happened because loongson64 didn't define array
of pg_data_t as node_data like most other architectures
From: "Mike Rapoport (Microsoft)"
Make definition of node_data match other architectures.
This will allow pulling declaration of node_data to the generic mm code in
the following commit.
Signed-off-by: Mike Rapoport (Microsoft)
Reviewed-by: Jiaxun Yang
Reviewed-by: David Hildenbrand
Reviewed-
From: "Mike Rapoport (Microsoft)"
Commit f8f9f21c7848 ("MIPS: Fix build error for loongson64 and
sgi-ip27") added HAVE_ARCH_NODEDATA_EXTENSION to sgi-ip27 to silence a
compilation error that happened because sgi-ip27 didn't define array of
pg_data_t as node_data like most other architectures did.
From: "Mike Rapoport (Microsoft)"
For SGI IP27 machines node_possible_map is statically set to
NODE_MASK_ALL and it is not updated during NUMA initialization.
Ensure that it only contains nodes present in the system.
Signed-off-by: Mike Rapoport (Microsoft)
Reviewed-by: Jonathan Cameron
Teste
From: "Mike Rapoport (Microsoft)"
sgi-ip27 is the only system that defines NODE_DATA() differently than
the rest of NUMA machines.
Add node_data array of struct pglist pointers that will point to
__node_data[node]->pglist and redefine NODE_DATA() to use node_data
array.
This will allow pulling
From: "Mike Rapoport (Microsoft)"
The stub functions in kernel/numa.c belong to mm/ rather than to kernel/
Signed-off-by: Mike Rapoport (Microsoft)
Acked-by: David Hildenbrand
Reviewed-by: Jonathan Cameron
Tested-by: Zi Yan # for x86_64 and arm64
Tested-by: Jonathan Cameron [arm64 + CXL via
From: "Mike Rapoport (Microsoft)"
Hi,
Following the discussion about handling of CXL fixed memory windows on
arm64 [1] I decided to bite the bullet and move numa_memblks from x86 to
the generic code so they will be available on arm64/riscv and maybe on
loongarch sometime later.
While it could b
On Tue, Aug 6, 2024 at 5:37 PM Pasha Tatashin wrote:
>
> On Tue, Aug 6, 2024 at 4:53 PM Ira Weiny wrote:
> >
> > On Tue, Aug 06, 2024 at 01:59:54PM -0400, Pasha Tatashin wrote:
> > > On Mon, Aug 5, 2024 at 7:06 PM Dan Williams
> > > wrote:
> > > >
> > > > Pasha Tatashin wrote:
> > > > [..]
> >
On Tue, Aug 6, 2024 at 4:53 PM Ira Weiny wrote:
>
> On Tue, Aug 06, 2024 at 01:59:54PM -0400, Pasha Tatashin wrote:
> > On Mon, Aug 5, 2024 at 7:06 PM Dan Williams
> > wrote:
> > >
> > > Pasha Tatashin wrote:
> > > [..]
> > > > Thank you for the heads up. Can you please attach a full config file
On Mon, Aug 5, 2024 at 7:06 PM Dan Williams wrote:
>
> Pasha Tatashin wrote:
> [..]
> > Thank you for the heads up. Can you please attach a full config file,
> > also was anyone able to reproduce this problem in qemu with emulated
> > nvdimm?
>
> Yes, I can reproduce the crash just by trying to re
On 01.08.24 08:08, Mike Rapoport wrote:
From: "Mike Rapoport (Microsoft)"
Until now arch_numa was directly translating firmware NUMA information
to memblock.
Using numa_memblks as an intermediate step has a few advantages:
* alignment with more battle tested x86 implementation
* availability o
On 01.08.24 08:08, Mike Rapoport wrote:
From: "Mike Rapoport (Microsoft)"
The x86 implementation of range-to-target_node lookup (i.e.
phys_to_target_node() and memory_add_physaddr_to_nid()) relies on
numa_memblks.
Since numa_memblks are now part of the generic code, move these
functions from x
On 01.08.24 08:08, Mike Rapoport wrote:
From: "Mike Rapoport (Microsoft)"
NUMA emulation can be now enabled on arm64 and riscv in addition to x86.
Move description of numa=fake parameters from x86 documentation of
admin-guide/kernel-parameters.txt
Suggested-by: Zi Yan
Signed-off-by: Mike Rap
On 01.08.24 08:08, Mike Rapoport wrote:
From: "Mike Rapoport (Microsoft)"
Currently of_numa_parse_memory_nodes() returns 0 if no "memory" node in
device tree contains "numa-node-id" property. This makes of_numa_init()
to return "success" despite no NUMA nodes were actually parsed and set
up.
a
On 01.08.24 08:08, Mike Rapoport wrote:
From: "Mike Rapoport (Microsoft)"
numa_cleanup_meminfo() moves blocks outside system RAM to
numa_reserved_meminfo and it uses 0 and PFN_PHYS(max_pfn) to determine
the memory boundaries.
Replace the memory range boundaries with more portable
memblock_star
On 06.08.24 15:20, David Hildenbrand wrote:
On 01.08.24 08:08, Mike Rapoport wrote:
From: "Mike Rapoport (Microsoft)"
Move numa_emulation codfrom arch/x86 to mm/numa_emulation.c
This code will be later reused by arch_numa.
I'm confused why documentation lists for "numa=fake="
[KNL, ARM64,
On 01.08.24 08:08, Mike Rapoport wrote:
From: "Mike Rapoport (Microsoft)"
Make functions and variables that are exclusively used by numa_memblks
static.
Move numa_nodemask_from_meminfo() before its callers to avoid forward
declaration.
Signed-off-by: Mike Rapoport (Microsoft)
Tested-by: Zi Y
On 01.08.24 08:08, Mike Rapoport wrote:
From: "Mike Rapoport (Microsoft)"
Move most of x86::numa_init() to numa_memblks so that the latter will be
more self-contained.
With this numa_memblk data structures should not be exposed to the
architecture specific code.
Signed-off-by: Mike Rapoport (
On 01.08.24 08:08, Mike Rapoport wrote:
From: "Mike Rapoport (Microsoft)"
Move numa_emulation codfrom arch/x86 to mm/numa_emulation.c
This code will be later reused by arch_numa.
I'm confused why documentation lists for "numa=fake="
[KNL, ARM64, RISCV, X86, EARLY]
--
Cheers,
David / dhil
On 05.08.24 22:09, Dan Williams wrote:
Mike Rapoport wrote:
From: "Mike Rapoport (Microsoft)"
Move numa_emulation codfrom arch/x86 to mm/numa_emulation.c
s/codfrom/code from/
I am surprised that numa-emulation stayed x86 only for so long. I think
it is useful facility for debugging NUMA sca
On 01.08.24 08:08, Mike Rapoport wrote:
From: "Mike Rapoport (Microsoft)"
Move code dealing with numa_distance array from arch/x86 to
mm/numa_memblks.c
This code will be later reused by arch_numa.
No functional changes.
Signed-off-by: Mike Rapoport (Microsoft)
Tested-by: Zi Yan # for x86_6
On 01.08.24 08:08, Mike Rapoport wrote:
From: "Mike Rapoport (Microsoft)"
Move code dealing with numa_memblks from arch/x86 to mm/ and add Kconfig
options to let x86 select it in its Kconfig.
This code will be later reused by arch_numa.
No functional changes.
Signed-off-by: Mike Rapoport (Mi
On 01.08.24 08:08, Mike Rapoport wrote:
From: "Mike Rapoport (Microsoft)"
CPU id cannot be negative.
Making it unsigned also aligns with declarations in
include/asm-generic/numa.h used by arm64 and riscv and allows sharing
numa emulation code with these architectures.
Signed-off-by: Mike Rapo
On 01.08.24 08:08, Mike Rapoport wrote:
From: "Mike Rapoport (Microsoft)"
This is required to make numa emulation code architecture independent so
that it can be moved to generic code in following commits.
Signed-off-by: Mike Rapoport (Microsoft)
Reviewed-by: Jonathan Cameron
Tested-by: Zi Y
On 01.08.24 08:08, Mike Rapoport wrote:
From: "Mike Rapoport (Microsoft)"
This is required to make numa emulation code architecture independent so
that it can be moved to generic code in following commits.
Signed-off-by: Mike Rapoport (Microsoft)
Reviewed-by: Jonathan Cameron
Tested-by: Zi Y
On 01.08.24 08:08, Mike Rapoport wrote:
From: "Mike Rapoport (Microsoft)"
By the time numa_emulation() is called, all physical memory is already
mapped in the direct map and there is no need to define limits for
memblock allocation.
Replace memblock_phys_alloc_range() with memblock_alloc().
S
On 01.08.24 08:08, Mike Rapoport wrote:
From: "Mike Rapoport (Microsoft)"
The definitions of FAKE_NODE_MIN_SIZE and FAKE_NODE_MIN_HASH_MASK are
only used by numa emulation code, make them local to
arch/x86/mm/numa_emulation.c
Signed-off-by: Mike Rapoport (Microsoft)
Reviewed-by: Jonathan Came
On 01.08.24 08:08, Mike Rapoport wrote:
From: "Mike Rapoport (Microsoft)"
Instead of looping over numa_meminfo array to detect node's start and
end addresses use get_pfn_range_for_init().
This is shorter and make it easier to lift numa_memblks to generic code.
Signed-off-by: Mike Rapoport (Mi
On 01.08.24 08:08, Mike Rapoport wrote:
From: "Mike Rapoport (Microsoft)"
Allocation of numa_distance uses memblock_phys_alloc_range() to limit
allocation to be below the last mapped page.
But NUMA initializaition runs after the direct map is populated and
there is also code in setup_arch() th
On 01.08.24 08:08, Mike Rapoport wrote:
From: "Mike Rapoport (Microsoft)"
Commit f8f9f21c7848 ("MIPS: Fix build error for loongson64 and
sgi-ip27") added HAVE_ARCH_NODEDATA_EXTENSION to loongson64 to silence a
compilation error that happened because loongson64 didn't define array
of pg_data_t a
On 01.08.24 08:08, Mike Rapoport wrote:
From: "Mike Rapoport (Microsoft)"
Commit f8f9f21c7848 ("MIPS: Fix build error for loongson64 and
sgi-ip27") added HAVE_ARCH_NODEDATA_EXTENSION to sgi-ip27 to silence a
compilation error that happened because sgi-ip27 didn't define array of
pg_data_t as no
On 01.08.24 08:08, Mike Rapoport wrote:
From: "Mike Rapoport (Microsoft)"
For SGI IP27 machines node_possible_map is statically set to
NODE_MASK_ALL and it is not updated during NUMA initialization.
Ensure that it only contains nodes present in the system.
Signed-off-by: Mike Rapoport (Micros
On 01.08.24 08:08, Mike Rapoport wrote:
From: "Mike Rapoport (Microsoft)"
sgi-ip27 is the only system that defines NODE_DATA() differently than
the rest of NUMA machines.
Add node_data array of struct pglist pointers that will point to
__node_data[node]->pglist and redefine NODE_DATA() to use
54 matches
Mail list logo