Re: [PATCH v2 1/5] mm/vmalloc: remove map_kernel_range

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Excerpts from Nicholas Piggin's message of March 22, 2021 12:18 pm:
> This is a shim around vmap_pages_range, get rid of it.
> 
> Move the main API comment from the _noflush variant to the normal
> variant, and make _noflush internal to mm/.
> 

This requires a fix for nommu builds.
---

Fix "mm/vmalloc: remove map_kernel_range"

Fixes: "percpu.c:undefined reference to `vmap_pages_range_noflush'" on
riscv nommu builds.

Previous code had a strange NOMMU implementation of
map_kernel_range_noflush that came in with commit b554cb426a955
("NOMMU: support SMP dynamic percpu_alloc") which would return
success if the size was <= PAGE_SIZE, but that has no way of working
on NOMMU because the page can not be mapped to the new start address
even if there is only one of them. So change this code to always
return failure.

NOMMU probably needs to take a closer look at what it does with
percpu-vm.c and carve out a special case there if necessary rather
than pretend vmap works.

Signed-off-by: Nicholas Piggin <npiggin@xxxxxxxxx>
---
 mm/internal.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/mm/internal.h b/mm/internal.h
index 6d3fd85ab866..ac5d1abfb739 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -621,7 +621,16 @@ struct migration_target_control {
 /*
  * mm/vmalloc.c
  */
+#ifdef CONFIG_MMU
 int vmap_pages_range_noflush(unsigned long addr, unsigned long end,
                 pgprot_t prot, struct page **pages, unsigned int page_shift);
+#else
+static inline
+int vmap_pages_range_noflush(unsigned long addr, unsigned long end,
+                pgprot_t prot, struct page **pages, unsigned int page_shift)
+{
+	return -EINVAL;
+}
+#endif
 
 #endif	/* __MM_INTERNAL_H */
-- 
2.23.0






[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux