Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796322223; b=ylNOvZ14WnwL54/0KAM302QL1N6oboN7XflnLx5CuyHAy5xUClZwH5IS+MQ3FcUAw1XH ENYmaJ4J8VGkk9S2ICUd0jt5YFMruTlxWVPVanBa5p6u1Z5fFF5xVV8RZerkcXKc3wiOb p/wyX4pDF5juQzqxfbPtnOs6og6TDEB/PGSZDPjdOLFNGyb0O1w/0fYgmLE8AIbFQOJdq h6wchHfKdCaKwY1ZIaFbSzGXQie17Q1yI8syb1qHZwHzjimTdOPE4kd4gTThXYXDcV7PE 6LqUwZAHxB8ZZmP0VJyyuyDAVEyrcnLjAIAjpv1uZ9Dfe3b7q0jECcGuNF1dqAPW8+w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796322223; h=Received:DKIM-Signature:Date:To:From:In-Reply-To:References:Subject: Message-Id; bh=pAjHIeYlUTvWK6TBrAowIFEZigu34gv/RadECgjM+TY=; b=de1IIOpmlXGBavM5bLDHWe4M6ObxvXlzRoyLJjKdneuFJrOtnHQUFrFtlyuvuZpk3YWA g7lbBWLxsZV59qVq5qVE445S00ZNRnAsltcz4dWieHERMq+CBJSChq4vjcfh3aILfm/2N I1J5xxx3zKjsptsCRgeIvfljNsQAC5GQINtsX+m0X8UUhsNhzKtC0rHO+pDCqb81Dg40O V/gsJC4U9QhO3dekA4TkZ9z74C2PDdrauFNrCLgkGLAYGTVZiFObNYFoLEhtGDh3nfKqv vgZZ8EUHe+e5BEQKyzJXTgTZBeSr+HKIXFnfOhvoDGcsXKf9Wgr4uSItwZJ+4zdHQrw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=y0XOktW3; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 88266606A32C for ; Thu, 3 Dec 2026 18:23:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=y0XOktW3 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 519131F000C1; Thu, 3 Dec 2026 18:23:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1796322223; bh=pAjHIeYlUTvWK6TBrAowIFEZigu34gv/RadECgjM+TY=; h=Date:To:From:In-Reply-To:References:Subject; b=y0XOktW33iE89bsiCt74KUeP9cr2qh6tJFc0lCBAes7etoboScaXntwFbB5qzBeI9 WunDJKynnzExJr3qUvt2ohh6LiB6Ju6/Lj9W6QUSKljUNNgqc/PtTr8wDl/v1/zeSM 2NM5ZYws+79nDhLBXqUOv2KX8u6fkzim5TnOdI3Q= Date: Thu, 03 Dec 2026 10:23:42 -0800 To: mm-commits@vger.kernel.org,viro@zeniv.linux.org.uk,rppt@kernel.org, richard.henderson@linaro.org,qi.zheng@linux.dev,linmag7@gmail.com, julian.braha@gmail.com,joao@joaoff.com,geert@linux-m68k.org, catalin.marinas@arm.com,julianbraha@gmail.com,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20261203165851.2505535-1-julianbraha@gmail.com> References: <20261203165851.2505535-1-julianbraha@gmail.com> Subject: + alpha-cleanup-dead-alpha_large_vmalloc.patch added to mm-nonmm-unstable branch Message-Id: <20261203182343.519131F000C1@smtp.kernel.org> X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list The patch titled Subject: alpha: cleanup dead ALPHA_LARGE_VMALLOC has been added to the -mm mm-nonmm-unstable branch. Its filename is alpha-cleanup-dead-alpha_large_vmalloc.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/alpha-cleanup-dead-alpha_large_vmalloc.patch This patch will later appear in the mm-nonmm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm 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 via various branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there most days ------------------------------------------------------ From: Julian Braha Subject: alpha: cleanup dead ALPHA_LARGE_VMALLOC Date: Thu, 3 Dec 2026 16:58:51 +0000 Currently, the ALPHA_LARGE_VMALLOC config option can never be enabled, meaning that all references to it are dead code. As Al explained [1], the code for a larger vmalloc area set up only the first PGD slot at boot. It added PGD entries on demand and relied on the page fault handler to copy a missing entry into the faulting address space. That synchronization was racy. The 8 GiB vmalloc area fits in one PGD slot. callback_init() sets up that entry at boot, and pgd_alloc() copies it into each new address space. Later vmalloc updates use the lower-level page tables that all address spaces share. Let's remove this dead option and its associated code. This dead code was found by kconfirm, a static analysis tool for Kconfig. Link: https://patch.msgid.link/20261203165851.2505535-1-julianbraha@gmail.com Link: https://lore.kernel.org/all/20251130030146.GN3538@ZenIV/ [1] Signed-off-by: Julian Braha Signed-off-by: Andrew Morton Cc: Julian Braha Cc: Richard Henderson Cc: Magnus Lindholm Cc: Qi Zheng Cc: Al Viro Cc: Geert Uytterhoeven Cc: Catalin Marinas Cc: Mike Rapoport Cc: arch/alpha/Kconfig | 15 --------------- arch/alpha/include/asm/pgtable.h | 4 ---- arch/alpha/mm/fault.c | 24 ------------------------ arch/alpha/mm/init.c | 10 ++-------- 4 files changed, 2 insertions(+), 51 deletions(-) --- a/arch/alpha/include/asm/pgtable.h~alpha-cleanup-dead-alpha_large_vmalloc +++ a/arch/alpha/include/asm/pgtable.h @@ -50,11 +50,7 @@ struct vm_area_struct; /* Number of pointers that fit on a page: this will go away. */ #define PTRS_PER_PAGE (1UL << (PAGE_SHIFT-3)) -#ifdef CONFIG_ALPHA_LARGE_VMALLOC -#define VMALLOC_START 0xfffffe0000000000 -#else #define VMALLOC_START (-2*PGDIR_SIZE) -#endif #define VMALLOC_END (-PGDIR_SIZE) /* --- a/arch/alpha/Kconfig~alpha-cleanup-dead-alpha_large_vmalloc +++ a/arch/alpha/Kconfig @@ -521,21 +521,6 @@ config ALPHA_WTINT If unsure, say N. -# LARGE_VMALLOC is racy, if you *really* need it then fix it first -config ALPHA_LARGE_VMALLOC - bool - help - Process creation and other aspects of virtual memory management can - be streamlined if we restrict the kernel to one PGD for all vmalloc - allocations. This equates to about 8GB. - - Under normal circumstances, this is so far and above what is needed - as to be laughable. However, there are certain applications (such - as benchmark-grade in-kernel web serving) that can make use of as - much vmalloc space as is available. - - Say N unless you know you need gobs and gobs of vmalloc space. - config VERBOSE_MCHECK bool "Verbose Machine Checks" --- a/arch/alpha/mm/fault.c~alpha-cleanup-dead-alpha_large_vmalloc +++ a/arch/alpha/mm/fault.c @@ -152,10 +152,6 @@ do_page_fault(unsigned long address, uns if (!mm || faulthandler_disabled()) goto no_context; -#ifdef CONFIG_ALPHA_LARGE_VMALLOC - if (address >= TASK_SIZE) - goto vmalloc_fault; -#endif if (user_mode(regs)) flags |= FAULT_FLAG_USER; perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address); @@ -288,24 +284,4 @@ retry: : "access violation"); force_sig_fault(SIGSEGV, si_code, (void __user *) address); return; - -#ifdef CONFIG_ALPHA_LARGE_VMALLOC - vmalloc_fault: - if (user_mode(regs)) - goto do_sigsegv; - else { - /* Synchronize this task's top level page-table - with the "reference" page table from init. */ - long index = pgd_index(address); - pgd_t *pgd, *pgd_k; - - pgd = current->active_mm->pgd + index; - pgd_k = swapper_pg_dir + index; - if (!pgd_present(*pgd) && pgd_present(*pgd_k)) { - pgd_val(*pgd) = pgd_val(*pgd_k); - return; - } - goto no_context; - } -#endif } --- a/arch/alpha/mm/init.c~alpha-cleanup-dead-alpha_large_vmalloc +++ a/arch/alpha/mm/init.c @@ -45,12 +45,7 @@ pgd_alloc(struct mm_struct *mm) ret = __pgd_alloc(mm, 0); init = pgd_offset(&init_mm, 0UL); if (ret) { -#ifdef CONFIG_ALPHA_LARGE_VMALLOC - memcpy (ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD, - (PTRS_PER_PGD - USER_PTRS_PER_PGD - 1)*sizeof(pgd_t)); -#else pgd_val(ret[PTRS_PER_PGD-2]) = pgd_val(init[PTRS_PER_PGD-2]); -#endif /* The last PGD entry is the VPTB self-map. */ pgd_val(ret[PTRS_PER_PGD-1]) @@ -147,9 +142,8 @@ callback_init(void * kernel_end) On systems with larger consoles, additional pages will be allocated as needed during the mapping process. - In the case of not SRM, but not CONFIG_ALPHA_LARGE_VMALLOC, - we need to allocate the PGD we use for vmalloc before we start - forking other tasks. */ + With or without SRM, the vmalloc PGD entry must be set up early + so pgd_alloc() can copy it into each new address space. */ two_pages = (void *) (((unsigned long)kernel_end + ~PAGE_MASK) & PAGE_MASK); _ Patches currently in -mm which might be from julianbraha@gmail.com are alpha-cleanup-dead-alpha_large_vmalloc.patch