Re: [PATCH v1 2/2] LoongArch: mm: Expand modules virtual address space to 2GB
Mike Rapoport <[email protected]> Sun, 19 Jul 2026 12:01:53 +0300
| Newsgroups | dev.linux.lists.loongarch,org.kernel.vger.linux-kernel,org.kvack.linux-mm |
|---|---|
| Message-ID | <[email protected]> |
Hi, On Fri, Jul 17, 2026 at 03:57:15PM +0800, Tiezhu Yang wrote: > Frequent "execmem: unable to allocate memory" warnings are observed > during kernel module loading when updating the latest kernel. > > This is because the modules virtual address region on LoongArch is > tightly constrained to 256MB, while ARM64 and RISC-V are natively > configured with a spacious 2GB region. The constraint follows architecture ability to address kernel instructions and data from modules code. I don't know what are loongarch requirements, but I remember that arm64 added a layer of relocation support to allow 2G module address space. > Expand the modules virtual address space to 2GB for LoongArch to > eliminate these allocation bottlenecks. > > This change only applies to 64-bit kernels (CONFIG_64BIT), 32-bit > kernels (CONFIG_32BIT) are entirely unaffected since they do not > define separate module address regions. > > With this patch, there are no "execmem: unable to allocate memory" > warnings anymore for 64-bit kernels. > > Signed-off-by: Tiezhu Yang <[email protected]> > --- > arch/loongarch/include/asm/pgtable.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/loongarch/include/asm/pgtable.h b/arch/loongarch/include/asm/pgtable.h > index 223528c04d73..e5952ecd6a73 100644 > --- a/arch/loongarch/include/asm/pgtable.h > +++ b/arch/loongarch/include/asm/pgtable.h > @@ -96,7 +96,7 @@ struct vm_area_struct; > #ifdef CONFIG_64BIT > > #define MODULES_VADDR (vm_map_base + PCI_IOSIZE + (2 * PAGE_SIZE)) > -#define MODULES_END (MODULES_VADDR + SZ_256M) > +#define MODULES_END (MODULES_VADDR + SZ_2G) > > #ifdef CONFIG_KFENCE > #define KFENCE_AREA_SIZE (((CONFIG_KFENCE_NUM_OBJECTS + 1) * 2 + 2) * PAGE_SIZE) > -- > 2.42.0 > -- Sincerely yours, Mike.