All of lore.kernel.org
 help / color / mirror / Atom feed
* + arch_numa-simplify-numa_distance-allocation.patch added to -mm tree
@ 2021-09-30 20:30 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2021-09-30 20:30 UTC (permalink / raw)
  To: christophe.leroy, jgross, mm-commits, rppt, Shahab.Vahedi


The patch titled
     Subject: arch_numa: simplify numa_distance allocation
has been added to the -mm tree.  Its filename is
     arch_numa-simplify-numa_distance-allocation.patch

This patch should soon appear at
    https://ozlabs.org/~akpm/mmots/broken-out/arch_numa-simplify-numa_distance-allocation.patch
and later at
    https://ozlabs.org/~akpm/mmotm/broken-out/arch_numa-simplify-numa_distance-allocation.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Mike Rapoport <rppt@linux.ibm.com>
Subject: arch_numa: simplify numa_distance allocation

Patch series "memblock: cleanup memblock_free interface", v2.

This is the fix for memblock freeing APIs mismatch [1].

The first patch is a cleanup of numa_distance allocation in arch_numa I've
spotted during the conversion.  The second patch is a fix for Xen memory
freeing on some of the error paths.

[1] https://lore.kernel.org/all/CAHk-=wj9k4LZTz+svCxLYs5Y1=+yKrbAUArH1+ghyG3OLd8VVg@mail.gmail.com


This patch (of 6):

Memory allocation of numa_distance uses memblock_phys_alloc_range()
without actual range limits, converts the returned physical address to
virtual and then only uses the virtual address for further initialization.

Simplify this by replacing memblock_phys_alloc_range() with
memblock_alloc().

Link: https://lkml.kernel.org/r/20210930185031.18648-1-rppt@kernel.org
Link: https://lkml.kernel.org/r/20210930185031.18648-2-rppt@kernel.org
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Juergen Gross <jgross@suse.com>
Cc: Shahab Vahedi <Shahab.Vahedi@synopsys.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/base/arch_numa.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

--- a/drivers/base/arch_numa.c~arch_numa-simplify-numa_distance-allocation
+++ a/drivers/base/arch_numa.c
@@ -275,15 +275,13 @@ void __init numa_free_distance(void)
 static int __init numa_alloc_distance(void)
 {
 	size_t size;
-	u64 phys;
 	int i, j;
 
 	size = nr_node_ids * nr_node_ids * sizeof(numa_distance[0]);
-	phys = memblock_phys_alloc_range(size, PAGE_SIZE, 0, PFN_PHYS(max_pfn));
-	if (WARN_ON(!phys))
+	numa_distance = memblock_alloc(size, PAGE_SIZE);
+	if (WARN_ON(!numa_distance))
 		return -ENOMEM;
 
-	numa_distance = __va(phys);
 	numa_distance_cnt = nr_node_ids;
 
 	/* fill with the default distances */
_

Patches currently in -mm which might be from rppt@linux.ibm.com are

arch_numa-simplify-numa_distance-allocation.patch
xen-x86-free_p2m_page-use-memblock_free_ptr-to-free-a-virtual-pointer.patch
memblock-drop-memblock_free_early_nid-and-memblock_free_early.patch
memblock-stop-aliasing-__memblock_free_late-with-memblock_free_late.patch
memblock-rename-memblock_free-to-memblock_phys_free.patch
memblock-use-memblock_free-for-freeing-virtual-pointers.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-30 20:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-30 20:30 + arch_numa-simplify-numa_distance-allocation.patch added to -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.