Re: [PATCH v8 3/5] mm/hugetlb_vmemmap: move comment block to Documentation/vm

2022-03-10 Thread Mike Rapoport
Hi, On Mon, Mar 07, 2022 at 12:24:55PM +, Joao Martins wrote: > In preparation for device-dax for using hugetlbfs compound page tail > deduplication technique, move the comment block explanation into a > common place in Documentation/vm. > > Cc: Muchun Song > Cc: Mike Kravetz > Suggested-by

Re: [PATCH v8 3/5] mm/hugetlb_vmemmap: move comment block to Documentation/vm

2022-03-10 Thread Mike Rapoport
On Thu, Mar 10, 2022 at 11:32:21AM +, Joao Martins wrote: > On 3/10/22 10:32, Mike Rapoport wrote: > > Hi, > > > > On Mon, Mar 07, 2022 at 12:24:55PM +, Joao Martins wrote: > >> In preparation for device-dax for using hugetlbfs compound page tail > >

[PATCH v2 00/25] mm: introduce numa_memblks

2024-07-22 Thread Mike Rapoport
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. Whil

[PATCH v2 01/25] mm: move kernel/numa.c to mm/

2024-07-22 Thread Mike Rapoport
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 --- kernel/Makefile | 1 - mm/Makefile | 1 + {kernel =&g

[PATCH v2 02/25] MIPS: sgi-ip27: make NODE_DATA() the same as on all other architectures

2024-07-22 Thread Mike Rapoport
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

[PATCH v2 03/25] MIPS: sgi-ip27: ensure node_possible_map only contains valid nodes

2024-07-22 Thread Mike Rapoport
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) --- arch/mips/sgi-ip27/

[PATCH v2 04/25] MIPS: sgi-ip27: drop HAVE_ARCH_NODEDATA_EXTENSION

2024-07-22 Thread Mike Rapoport
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 mos

[PATCH v2 05/25] MIPS: loongson64: rename __node_data to node_data

2024-07-22 Thread Mike Rapoport
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

[PATCH v2 06/25] MIPS: loongson64: drop HAVE_ARCH_NODEDATA_EXTENSION

2024-07-22 Thread Mike Rapoport
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

[PATCH v2 07/25] mm: drop CONFIG_HAVE_ARCH_NODEDATA_EXTENSION

2024-07-22 Thread Mike Rapoport
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 memblock_alloc(), remove arch_refresh_nodedata() a

[PATCH v2 08/25] arch, mm: move definition of node_data to generic code

2024-07-22 Thread Mike Rapoport
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 declarat

[PATCH v2 09/25] arch, mm: pull out allocation of NODE_DATA to generic code

2024-07-22 Thread Mike Rapoport
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() fu

[PATCH v2 10/25] x86/numa: simplify numa_distance allocation

2024-07-22 Thread Mike Rapoport
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 r

[PATCH v2 11/25] x86/numa: use get_pfn_range_for_nid to verify that node spans memory

2024-07-22 Thread Mike Rapoport
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) --- arch/x86

[PATCH v2 12/25] x86/numa: move FAKE_NODE_* defines to numa_emu

2024-07-22 Thread Mike Rapoport
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 --- arch/x86/include/

[PATCH v2 13/25] x86/numa_emu: simplify allocation of phys_dist

2024-07-22 Thread Mike Rapoport
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

[PATCH v2 14/25] x86/numa_emu: split __apicid_to_node update to a helper function

2024-07-22 Thread Mike Rapoport
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 --- arch/x86/include/asm/numa.h | 2 ++ a

[PATCH v2 15/25] x86/numa_emu: use a helper function to get MAX_DMA32_PFN

2024-07-22 Thread Mike Rapoport
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 --- arch/x86/include/asm/numa.h | 1 + a

[PATCH v2 16/25] x86/numa: numa_{add,remove}_cpu: make cpu parameter unsigned

2024-07-22 Thread Mike Rapoport
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

[PATCH v2 17/25] mm: introduce numa_memblks

2024-07-22 Thread Mike Rapoport
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) --- arch/x

[PATCH v2 18/25] mm: move numa_distance and related code from x86 to numa_memblks

2024-07-22 Thread Mike Rapoport
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) --- arch/x86/include/asm/numa.h | 2 - arch/x86

[PATCH v2 19/25] mm: introduce numa_emulation

2024-07-22 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Move numa_emulation codfrom 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) --- arch/x86/Kconfig | 8 arch/x86/include/

[PATCH v2 20/25] mm: numa_memblks: introduce numa_memblks_init

2024-07-22 Thread Mike Rapoport
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) --- arch/x86

[PATCH v2 21/25] mm: numa_memblks: make several functions and variables static

2024-07-22 Thread Mike Rapoport
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) --- include/linux/numa_memblks.h | 8 --

[PATCH v2 22/25] mm: numa_memblks: use memblock_{start,end}_of_DRAM() when sanitizing meminfo

2024-07-22 Thread Mike Rapoport
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_e

[PATCH v2 23/25] arch_numa: switch over to numa_memblks

2024-07-22 Thread Mike Rapoport
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 * mainta

[PATCH v2 24/25] mm: make range-to-target_node lookup facility a part of numa_memblks

2024-07-22 Thread Mike Rapoport
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

[PATCH v2 25/25] docs: move numa=fake description to kernel-parameters.txt

2024-07-22 Thread Mike Rapoport
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) --- Doc

Re: [PATCH v2 00/25] mm: introduce numa_memblks

2024-07-26 Thread Mike Rapoport
On Wed, Jul 24, 2024 at 10:48:42PM -0400, Zi Yan wrote: > On 24 Jul 2024, at 20:35, Zi Yan wrote: > > On 24 Jul 2024, at 18:44, Zi Yan wrote: > >> > >> Hi, > >> > >> I have tested this series on both x86_64 and arm64. It works fine on > >> x86_64. > >> All numa=fake= options work as they did befor

[PATCH v3 00/26] mm: introduce numa_memblks

2024-07-31 Thread Mike Rapoport
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. Whil

[PATCH v3 01/26] mm: move kernel/numa.c to mm/

2024-07-31 Thread Mike Rapoport
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 --- kernel/Makefile

[PATCH v3 02/26] MIPS: sgi-ip27: make NODE_DATA() the same as on all other architectures

2024-07-31 Thread Mike Rapoport
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

[PATCH v3 03/26] MIPS: sgi-ip27: ensure node_possible_map only contains valid nodes

2024-07-31 Thread Mike Rapoport
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) --- arch/mips/sgi-ip27/

[PATCH v3 04/26] MIPS: sgi-ip27: drop HAVE_ARCH_NODEDATA_EXTENSION

2024-07-31 Thread Mike Rapoport
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 mos

[PATCH v3 05/26] MIPS: loongson64: rename __node_data to node_data

2024-07-31 Thread Mike Rapoport
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

[PATCH v3 06/26] MIPS: loongson64: drop HAVE_ARCH_NODEDATA_EXTENSION

2024-07-31 Thread Mike Rapoport
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

[PATCH v3 07/26] mm: drop CONFIG_HAVE_ARCH_NODEDATA_EXTENSION

2024-07-31 Thread Mike Rapoport
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 memblock_alloc(), remove arch_refresh_nodedata() a

[PATCH v3 08/26] arch, mm: move definition of node_data to generic code

2024-07-31 Thread Mike Rapoport
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 declarat

[PATCH v3 09/26] arch, mm: pull out allocation of NODE_DATA to generic code

2024-07-31 Thread Mike Rapoport
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() fu

[PATCH v3 10/26] x86/numa: simplify numa_distance allocation

2024-07-31 Thread Mike Rapoport
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 r

[PATCH v3 11/26] x86/numa: use get_pfn_range_for_nid to verify that node spans memory

2024-07-31 Thread Mike Rapoport
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 Ya

[PATCH v3 12/26] x86/numa: move FAKE_NODE_* defines to numa_emu

2024-07-31 Thread Mike Rapoport
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

[PATCH v3 13/26] x86/numa_emu: simplify allocation of phys_dist

2024-07-31 Thread Mike Rapoport
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

[PATCH v3 14/26] x86/numa_emu: split __apicid_to_node update to a helper function

2024-07-31 Thread Mike Rapoport
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 ---

[PATCH v3 15/26] x86/numa_emu: use a helper function to get MAX_DMA32_PFN

2024-07-31 Thread Mike Rapoport
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 ---

[PATCH v3 16/26] x86/numa: numa_{add,remove}_cpu: make cpu parameter unsigned

2024-07-31 Thread Mike Rapoport
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

[PATCH v3 17/26] mm: introduce numa_memblks

2024-07-31 Thread Mike Rapoport
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 #

[PATCH v3 18/26] mm: move numa_distance and related code from x86 to numa_memblks

2024-07-31 Thread Mike Rapoport
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 --- arch/x86/i

[PATCH v3 19/26] mm: introduce numa_emulation

2024-07-31 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Move numa_emulation codfrom 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 --- arch/x86/Kconfig

[PATCH v3 20/26] mm: numa_memblks: introduce numa_memblks_init

2024-07-31 Thread Mike Rapoport
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

[PATCH v3 21/26] mm: numa_memblks: make several functions and variables static

2024-07-31 Thread Mike Rapoport
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 --

[PATCH v3 22/26] mm: numa_memblks: use memblock_{start,end}_of_DRAM() when sanitizing meminfo

2024-07-31 Thread Mike Rapoport
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_e

[PATCH v3 23/26] of, numa: return -EINVAL when no numa-node-id is found

2024-07-31 Thread Mike Rapoport
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. ar

[PATCH v3 24/26] arch_numa: switch over to numa_memblks

2024-07-31 Thread Mike Rapoport
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 * mainta

[PATCH v3 25/26] mm: make range-to-target_node lookup facility a part of numa_memblks

2024-07-31 Thread Mike Rapoport
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

[PATCH v3 26/26] docs: move numa=fake description to kernel-parameters.txt

2024-07-31 Thread Mike Rapoport
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) --- Doc

Re: [PATCH v3 07/26] mm: drop CONFIG_HAVE_ARCH_NODEDATA_EXTENSION

2024-08-04 Thread Mike Rapoport
On Sat, Aug 03, 2024 at 11:58:13AM -0700, Andrew Morton wrote: > On Fri, 2 Aug 2024 10:49:22 +0100 Jonathan Cameron > wrote: > > > > --- a/mm/mm_init.c > > > +++ b/mm/mm_init.c > > > @@ -1838,11 +1838,10 @@ void __init free_area_init(unsigned long > > > *max_zone_pfn) > > > > > > if

Re: [PATCH v3 07/26] mm: drop CONFIG_HAVE_ARCH_NODEDATA_EXTENSION

2024-08-05 Thread Mike Rapoport
On Sun, Aug 04, 2024 at 04:11:19PM +0100, Jonathan Cameron wrote: > On Sun, 4 Aug 2024 10:24:15 +0300 > Mike Rapoport wrote: > > > On Sat, Aug 03, 2024 at 11:58:13AM -0700, Andrew Morton wrote: > > > On Fri, 2 Aug 2024 10:49:22 +0100 Jonathan Cameron > > > w

Re: [PATCH v3 09/26] arch, mm: pull out allocation of NODE_DATA to generic code

2024-08-05 Thread Mike Rapoport
On Fri, Aug 02, 2024 at 10:55:27AM +0100, Jonathan Cameron wrote: > On Thu, 1 Aug 2024 09:08:09 +0300 > Mike Rapoport wrote: > > > From: "Mike Rapoport (Microsoft)" > > > > Architectures that support NUMA duplicate the code that allocates > > NOD

Re: [PATCH v3 22/26] mm: numa_memblks: use memblock_{start,end}_of_DRAM() when sanitizing meminfo

2024-08-05 Thread Mike Rapoport
On Mon, Aug 05, 2024 at 01:21:02PM -0700, Dan Williams wrote: > 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) t

Re: [PATCH v3 11/26] x86/numa: use get_pfn_range_for_nid to verify that node spans memory

2024-08-05 Thread Mike Rapoport
On Mon, Aug 05, 2024 at 01:03:56PM -0700, Dan Williams wrote: > 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(). >

[PATCH v4 00/26] mm: introduce numa_memblks

2024-08-06 Thread Mike Rapoport
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. Whil

[PATCH v4 01/26] mm: move kernel/numa.c to mm/

2024-08-06 Thread Mike Rapoport
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 [a

[PATCH v4 02/26] MIPS: sgi-ip27: make NODE_DATA() the same as on all other architectures

2024-08-06 Thread Mike Rapoport
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

[PATCH v4 03/26] MIPS: sgi-ip27: ensure node_possible_map only contains valid nodes

2024-08-06 Thread Mike Rapoport
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: Jonath

[PATCH v4 04/26] MIPS: sgi-ip27: drop HAVE_ARCH_NODEDATA_EXTENSION

2024-08-06 Thread Mike Rapoport
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 mos

[PATCH v4 05/26] MIPS: loongson64: rename __node_data to node_data

2024-08-06 Thread Mike Rapoport
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

[PATCH v4 06/26] MIPS: loongson64: drop HAVE_ARCH_NODEDATA_EXTENSION

2024-08-06 Thread Mike Rapoport
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

[PATCH v4 07/26] arch, mm: move definition of node_data to generic code

2024-08-06 Thread Mike Rapoport
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 declarat

[PATCH v4 08/26] mm: drop CONFIG_HAVE_ARCH_NODEDATA_EXTENSION

2024-08-06 Thread Mike Rapoport
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

[PATCH v4 09/26] arch, mm: pull out allocation of NODE_DATA to generic code

2024-08-06 Thread Mike Rapoport
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() fu

[PATCH v4 10/26] x86/numa: simplify numa_distance allocation

2024-08-06 Thread Mike Rapoport
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 r

[PATCH v4 11/26] x86/numa: use get_pfn_range_for_nid to verify that node spans memory

2024-08-06 Thread Mike Rapoport
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 Ya

[PATCH v4 12/26] x86/numa: move FAKE_NODE_* defines to numa_emu

2024-08-06 Thread Mike Rapoport
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

[PATCH v4 13/26] x86/numa_emu: simplify allocation of phys_dist

2024-08-06 Thread Mike Rapoport
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

[PATCH v4 14/26] x86/numa_emu: split __apicid_to_node update to a helper function

2024-08-06 Thread Mike Rapoport
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

[PATCH v4 15/26] x86/numa_emu: use a helper function to get MAX_DMA32_PFN

2024-08-06 Thread Mike Rapoport
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

[PATCH v4 16/26] x86/numa: numa_{add,remove}_cpu: make cpu parameter unsigned

2024-08-06 Thread Mike Rapoport
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

[PATCH v4 17/26] mm: introduce numa_memblks

2024-08-06 Thread Mike Rapoport
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 #

[PATCH v4 18/26] mm: move numa_distance and related code from x86 to numa_memblks

2024-08-06 Thread Mike Rapoport
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: Jonath

[PATCH v4 19/26] mm: introduce numa_emulation

2024-08-06 Thread Mike Rapoport
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

[PATCH v4 20/26] mm: numa_memblks: introduce numa_memblks_init

2024-08-06 Thread Mike Rapoport
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

[PATCH v4 21/26] mm: numa_memblks: make several functions and variables static

2024-08-06 Thread Mike Rapoport
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 R

[PATCH v4 22/26] mm: numa_memblks: use memblock_{start,end}_of_DRAM() when sanitizing meminfo

2024-08-06 Thread Mike Rapoport
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_e

[PATCH v4 23/26] of, numa: return -EINVAL when no numa-node-id is found

2024-08-06 Thread Mike Rapoport
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. ar

[PATCH v4 24/26] arch_numa: switch over to numa_memblks

2024-08-06 Thread Mike Rapoport
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 * mainta

[PATCH v4 25/26] mm: make range-to-target_node lookup facility a part of numa_memblks

2024-08-06 Thread Mike Rapoport
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

[PATCH v4 26/26] docs: move numa=fake description to kernel-parameters.txt

2024-08-06 Thread Mike Rapoport
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

Re: [PATCH v4 24/26] arch_numa: switch over to numa_memblks

2024-08-07 Thread Mike Rapoport
On Wed, Aug 07, 2024 at 08:58:37AM +0200, Arnd Bergmann wrote: > 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. >

Re: [PATCH] pstore/ramoops: Fix typo as there is no "reserver"

2024-08-07 Thread Mike Rapoport
dd ramoops.mem_name= command line > option") > Signed-off-by: Steven Rostedt (Google) Acked-by: Mike Rapoport (Microsoft) > --- > Note, I did have this fixed, but the previous version was pulled: > > https://lore.kernel.org/linux-trace-kernel/20240613233446.283241...@go

Re: [PATCH 1/5] alloc_tag: load module tags into separate continuous memory

2024-08-20 Thread Mike Rapoport
On Mon, Aug 19, 2024 at 08:15:07AM -0700, Suren Baghdasaryan wrote: > When a module gets unloaded there is a possibility that some of the > allocations it made are still used and therefore the allocation tags > corresponding to these allocations are still referenced. As such, the > memory for these

Re: [PATCH v4 24/26] arch_numa: switch over to numa_memblks

2024-08-27 Thread Mike Rapoport
Hi, On Mon, Aug 26, 2024 at 06:17:22PM +, Bruno Faccini wrote: > > On 7 Aug 2024, at 2:41, Mike Rapoport wrote: > > > > From: "Mike Rapoport (Microsoft)" > > > > Until now arch_numa was directly translating firmware NUMA information > >

Re: [PATCH] docs/vm: transhuge: fix typo in madvise reference

2019-07-18 Thread Mike Rapoport
On Tue, Jul 16, 2019 at 10:49:08AM -0400, Jeremy Cline wrote: > Fix an off-by-one typo in the transparent huge pages admin > documentation. > > Signed-off-by: Jeremy Cline Acked-by: Mike Rapoport > --- > Documentation/admin-guide/mm/transhuge.rst | 2 +- > 1 file chang

Re: [PATCH v3 2/2] doc: Update documentation for page_idle virtual address indexing

2019-07-30 Thread Mike Rapoport
On Fri, Jul 26, 2019 at 11:23:19AM -0400, Joel Fernandes (Google) wrote: > This patch updates the documentation with the new page_idle tracking > feature which uses virtual address indexing. > > Signed-off-by: Joel Fernandes (Google) One nit below, otherwise Reviewed-by: M

[PATCH] docs: reorder memory-hotplug documentation

2019-05-14 Thread Mike Rapoport
The "Locking Internals" section of the memory-hotplug documentation is duplicated in admin-guide and core-api. Drop the admin-guide copy as locking internals does not belong there. While on it, move the "Future Work" section to the core-api part. Signed-off-by: Mike Rapoport

Re: [PATCH] docs: reorder memory-hotplug documentation

2019-05-21 Thread Mike Rapoport
On Tue, May 21, 2019 at 12:41:50PM +0200, David Hildenbrand wrote: > On 14.05.19 10:23, Mike Rapoport wrote: > > The "Locking Internals" section of the memory-hotplug documentation is > > duplicated in admin-guide and core-api. Drop the admin-guide copy as > > lo

Re: [PATCH 3/8] docs: fix numaperf.rst and add it to the doc tree

2019-05-22 Thread Mike Rapoport
block and add the file to the document tree. > > Fixes: 13bac55ef7ae ("doc/mm: New documentation for memory performance") > Cc: Keith Busch > Cc: Mike Rapoport > Signed-off-by: Jonathan Corbet Reviewed-by: Mike Rapoport > --- > Documentation/admin-guide/mm/index.r

Re: [PATCH v1] docs/core-api: Add integer power functions to the list

2019-06-05 Thread Mike Rapoport
; > Signed-off-by: Andy Shevchenko Acked-by: Mike Rapoport > --- > Documentation/core-api/kernel-api.rst | 9 + > 1 file changed, 9 insertions(+) > > diff --git a/Documentation/core-api/kernel-api.rst > b/Documentation/core-api/kernel-api.rst > index 65

Re: [PATCH v1] docs/core-api: Add string helpers API to the list

2019-06-05 Thread Mike Rapoport
vchenko Acked-by: Mike Rapoport > --- > Documentation/core-api/kernel-api.rst | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/Documentation/core-api/kernel-api.rst > b/Documentation/core-api/kernel-api.rst > index a53ec2eb8176..65ae2bf1f86d 100644 > -

[PATCH] scripts/sphinx-pre-install: fix out-of-tree build

2019-06-20 Thread Mike Rapoport
rget 'htmldocs' failed make[2]: *** [htmldocs] Error 2 The scripts/sphinx-pre-install is trying to open files in the current directory which is $KBUILD_OUTPUT rather than in $srctree. Fix it. Signed-off-by: Mike Rapoport --- scripts/sphinx-pre-install | 5 +++-- 1 file changed, 3 insertions

  1   2   3   >