Re: [PATCH v1 2/2] LoongArch: mm: Expand modules virtual address space to 2GB
From: Xi Ruoyao
Date: Sun Jul 19 2026 - 11:34:00 EST
On Sun, 2026-07-19 at 12:01 +0300, Mike Rapoport wrote:
> 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.
IIUC on LoongArch the size of one module is limited to 256MB, but the
total size of modules can be up to 2GB, as the module loader creates PLT
entries for calls across the module boundary.
I'd seen the "execmem: unable to allocate memory" error loading the
large amdgpu module. But after I stripped the amdgpu module those
warnings gone away. To me this is very strange: shouldn't the module
loader just ignore the debug info even if it's not stripped instead of
requesting execmem for it???
--
Xi Ruoyao <xry111@xxxxxxxxxxx>