From nobody Sat Jul 25 06:02:56 2026 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9B3D33ACA49 for ; Fri, 17 Jul 2026 07:57:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=114.242.206.163 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784275042; cv=none; b=ttFMp7fAZtzCGzuJ//6sv5+N3mWDdobJhuN1cxyGelnnjydFI3vB9WLxX07Yt8gN0mRKpGEtQe5KKJrDy2gWKp7APGcWiZXqnlqZsId/9YIJAyJgqYt7PfTxjFfkBLO9ZFXfwuBaZutIFbPs4VIHeseXOiSyDWS/0kAhFjAma3o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784275042; c=relaxed/simple; bh=0LcCs4VkI0i4I902Nhcw62yUBf6er7y5mHgGs6CMtEg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=T1SQt9Q1kccazt86b1TuCsmA/Tp4FOvFr+Xy6AB8K7CghLZ5jduxcuIcETzS6tiH8yAHonktB8LsaZxPUS7H0fRxTcHxH3sFNHYIeuI+KXCh1r/ZGstfM6REyuj6g+k7tbB2gcgJvJB2zccZ2GhnaDMx8zCpQ7hWCVZ69c0H+9w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn; spf=pass smtp.mailfrom=loongson.cn; arc=none smtp.client-ip=114.242.206.163 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=loongson.cn Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8CxJOpf4FlqEnsEAA--.16557S3; Fri, 17 Jul 2026 15:57:19 +0800 (CST) Received: from linux.localdomain (unknown [113.200.148.30]) by front1 (Coremail) with SMTP id qMiowJCxq8Rc4FlqDNUPAA--.25915S3; Fri, 17 Jul 2026 15:57:17 +0800 (CST) From: Tiezhu Yang To: Andrew Morton , Mike Rapoport , Huacai Chen Cc: linux-mm@kvack.org, loongarch@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v1 1/2] mm/execmem: Print size, align and caller on allocation failure Date: Fri, 17 Jul 2026 15:57:14 +0800 Message-ID: <20260717075715.25513-2-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20260717075715.25513-1-yangtiezhu@loongson.cn> References: <20260717075715.25513-1-yangtiezhu@loongson.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: qMiowJCxq8Rc4FlqDNUPAA--.25915S3 X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBj9xXoW7JFy7Gr43Gr4UZFyrKr4kGrX_yoWkZrcEgF 40gr98Gr9IyF12k3Wqq3W3Xr4Ig3y8ur10gwn2qwnxZa4DJF48Aa4ktrs8urs7u3yqkFn8 AanIkw4akr47GosvyTuYvTs0mTUanT9S1TB71UUUUjUqnTZGkaVYY2UrUUUUj1kv1TuYvT s0mT0YCTnIWjqI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUI cSsGvfJTRUUUbSxYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20x vaj40_Wr0E3s1l1IIY67AEw4v_Jrv_JF1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxS w2x7M28EF7xvwVC0I7IYx2IY67AKxVW8JVW5JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxV W8JVWxJwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6r4UJVWxJr1ln4kS14v26r1Y6r17M2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12 xvs2x26I8E6xACxx1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1q 6rW5McIj6I8E87Iv67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64 vIr41lc7CjxVAaw2AFwI0_JF0_Jw1l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_ Jr0_Gr1l4IxYO2xFxVAFwI0_Jrv_JF1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8Gjc xK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2Ix0 cI8IcVAFwI0_JFI_Gr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8V AvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E 14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxUxhiSDUUUU Content-Type: text/plain; charset="utf-8" The current execmem_vmalloc() function reports an allocation failure with a simplistic "unable to allocate memory" message. This notifies the user that an error occurred, but it acts as a black box during debugging. Enhance pr_warn_ratelimited() within execmem_vmalloc() to explicitly print the requested allocation size, alignment constraints, and the symbolic caller. This diagnostic visibility is valuable for analyzing the root cause of allocation failures and tracking misbehaving subsystems without inducing log pollution. Signed-off-by: Tiezhu Yang --- mm/execmem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mm/execmem.c b/mm/execmem.c index 084a207e4278..f3bc68e0eb98 100644 --- a/mm/execmem.c +++ b/mm/execmem.c @@ -50,7 +50,9 @@ static void *execmem_vmalloc(struct execmem_range *range,= size_t size, } =20 if (!p) { - pr_warn_ratelimited("unable to allocate memory\n"); + pr_warn_ratelimited("unable to allocate memory, " + "size=3D%zu, align=3D%u, caller is %pS\n", + size, align, __builtin_return_address(0)); return NULL; } =20 --=20 2.42.0 From nobody Sat Jul 25 06:02:56 2026 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0DCD931E82E for ; Fri, 17 Jul 2026 07:57:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=114.242.206.163 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784275048; cv=none; b=mITjQosGjw4NV+LL77FMS3InAS8C/KIRoCU6oHpy5EufATWG5kXOwCxNNtKCIrninwEIyUSeoGv+VpiWllmxJSddjqUD54UMcD99vtz9VfEZ88twVIFQXWCxOGEaro0MyYhyG2Usi2t/KMFayt8y+Sr5hPhX4M+rRIe4/Jo4Hsg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784275048; c=relaxed/simple; bh=ym+ZvLteeJXRkmKHdlqOSEVJpCko5cWQOCUxXgmJOko=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JWyJpDwaDlWn3DRDtJy1YvoTOZ0HKde7tQVqw+WI1OzbOjvh0XPvDcsW/S5TJIOSD3U8EQXFIlsekCrz9H5cpUDnT8QQ/q/xK+GwrXZtwCvJqp21ejRyxXshpFSCDcXfVG6VuLTowpbaVLTj/aXeTiLCZdt7lvTy8+W5onLmWxo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn; spf=pass smtp.mailfrom=loongson.cn; arc=none smtp.client-ip=114.242.206.163 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=loongson.cn Received: from loongson.cn (unknown [113.200.148.30]) by gateway (Coremail) with SMTP id _____8Axiutk4FlqG3sEAA--.17824S3; Fri, 17 Jul 2026 15:57:24 +0800 (CST) Received: from linux.localdomain (unknown [113.200.148.30]) by front1 (Coremail) with SMTP id qMiowJCxq8Rc4FlqDNUPAA--.25915S4; Fri, 17 Jul 2026 15:57:18 +0800 (CST) From: Tiezhu Yang To: Andrew Morton , Mike Rapoport , Huacai Chen Cc: linux-mm@kvack.org, loongarch@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v1 2/2] LoongArch: mm: Expand modules virtual address space to 2GB Date: Fri, 17 Jul 2026 15:57:15 +0800 Message-ID: <20260717075715.25513-3-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20260717075715.25513-1-yangtiezhu@loongson.cn> References: <20260717075715.25513-1-yangtiezhu@loongson.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: qMiowJCxq8Rc4FlqDNUPAA--.25915S4 X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBj93XoW7uryfuFWkuw1rJr1fZFyxZwc_yoW8Xr43pF WDAr9YyrW8Wr1SyaykXwnxWr1Yva93GrZIgw4rWr18AF9Iv3WDZr4kX3W3ZF18Xa93KFyx XFyI9w4ava4DJacCm3ZEXasCq-sJn29KB7ZKAUJUUUU7529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUBIb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r126r13M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVW8Jr0_Cr1UM2kKe7AKxVWUXVWUAwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07 AIYIkI8VC2zVCFFI0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWU tVWrXwAv7VC2z280aVAFwI0_Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7V AKI48JMxkF7I0En4kS14v26r126r1DMxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY 6r1j6r4UMxCIbckI1I0E14v26r1Y6r17MI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7 xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6xII jxv20xvE14v26r4j6ryUMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAIw2 0EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x02 67AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU8EoGPUUUUU== Content-Type: text/plain; charset="utf-8" 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. 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 --- 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 =20 #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) =20 #ifdef CONFIG_KFENCE #define KFENCE_AREA_SIZE (((CONFIG_KFENCE_NUM_OBJECTS + 1) * 2 + 2) * PAGE= _SIZE) --=20 2.42.0