From patchwork Tue Dec 10 16:05:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 13901631 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11386E77180 for ; Tue, 10 Dec 2024 16:06:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 86A486B020E; Tue, 10 Dec 2024 11:06:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 819CE6B0213; Tue, 10 Dec 2024 11:06:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6BB326B0246; Tue, 10 Dec 2024 11:06:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 4D8FB6B020E for ; Tue, 10 Dec 2024 11:06:53 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id A9DF4AE9BD for ; Tue, 10 Dec 2024 16:06:52 +0000 (UTC) X-FDA: 82879527024.25.23B0114 Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf09.hostedemail.com (Postfix) with ESMTP id 0EEAF14000B for ; Tue, 10 Dec 2024 16:06:35 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ADJHIkfi; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf09.hostedemail.com: domain of arnd@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=arnd@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733846800; a=rsa-sha256; cv=none; b=kQBboAWTZ9OLg8zc8U54lp1LoEP/UJToxJlrU/D5jzR4SnFfOfSlKi8aqTvQE1A5l41bkN dnI7fR1srJwefixd4pSw5/YeSP3Kav+NOWEso3szJ2XLDfXtXMBRjw/jOcMoikWUG486Q9 E77z0dovV0gVWSGgqPhOv3y6zedc2Lk= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ADJHIkfi; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf09.hostedemail.com: domain of arnd@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=arnd@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733846800; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=9IiwcG3N1ugBdkFig95nrPfsRqleGF0oTApMmnF7bcQ=; b=kD5bzC9ry0khQISKeH2iy1+eML2T/lTPI3ppMfBryAQNYvkAsU4gv+HEAjH1coZDNAp9/5 cvqTVN5ogOyFhc99oIHupKoCW1vVdRhOZEWfBCMf860FDtbifCkfOoH1ecUyMoSyUSObZy gJhEZkDhMUdj5WcOnmOujQWFY2Kmm+8= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 073FEA419A7; Tue, 10 Dec 2024 16:04:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2AE5C4CEE1; Tue, 10 Dec 2024 16:06:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1733846810; bh=IDAs66loD46ejrDZgcdhA2wj912kFUy5s0hoLSzyXSk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ADJHIkfiTV0YsOu/HXMzwiS2RxR+5D0cCrNlcj00SQU1YljAfFMCaXaJUWQ2rdFOU iSq4zLD9LGm3Rf1r52f2jsvLRxJzbx4RHtht+B0YxK/e+1a1h1XYL9yntzNDQfQiSZ Z5x1beU4WJoE/X7BOoMoY//o1542eZPoiKgXvjzBiFVv4Ok1RdB5kWh7b1KHLRwzuJ mITMmSURfkPXvsQi08gl0RbQOPq87tCYfo9u81kCz3a8Z/pS/rAzarx8y7plmv+tHv W3QP4/mwCMHdaVN4qnm8tdWHIryJnxDxcvzoT7KBq3kTjX98PcHL4zfil8uaKsh099 cHaTRkEQ4+Nsw== From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Arnd Bergmann , linux-mm@kvack.org, linux-rt-devel@lists.linux.dev, Ard Biesheuvel , Clark Williams , Jason Baron , Josh Poimboeuf , Linus Walleij , Mark Rutland , Matthew Wilcox , Peter Zijlstra , Russell King , Sebastian Andrzej Siewior , Steven Rostedt Subject: [PATCH 3/4] ARM: drop CONFIG_HIGHPTE support Date: Tue, 10 Dec 2024 17:05:55 +0100 Message-Id: <20241210160556.2341497-4-arnd@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241210160556.2341497-1-arnd@kernel.org> References: <20241210160556.2341497-1-arnd@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 0EEAF14000B X-Stat-Signature: xxzabdsojhs1g3rdfcf1wkhhw17jwtjw X-HE-Tag: 1733846795-448317 X-HE-Meta: U2FsdGVkX19nCGTMxtNEEQAqprT4IphaOghh47vl07Tg1wWS///YGhUcKoadYM/Dq2npw9i0WmGHYdnvWctC9jRnVpyd13x5FtOpipyv8FwL+dglX3AfIf7T9XdiH2OWGEIdB8dWon5q5iKaRgl6UBjrCRjH70SlJASjZspq26hB+jgWUgfBV21y79ptES3xaTqLfaNzEnwTWs6YIRrlraW+fHUzFiMvzDYEKgVqGJ5d6o0m9Ly3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ender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Arnd Bergmann CONFIG_HIGHPTE was added in linux-2.6.32, a few years before 64-bit support. At the time it made sense, as the CONFIG_ARM_LPAE option allowed systems with 16GB of memory that made lowmem a particularly scarce resource, and the HIGHPTE implementation gave feature parity with 32-bit x86 and frv machines. Since Arm is the last architecture remaining that uses this, and almost no 32-bit machines support more than 4GB of RAM, the cost of continuing to maintain HIGHPTE seems unjustified, so remove it here to allow simplifying the generic page table handling. Link: https://lore.kernel.org/lkml/20241204103042.1904639-8-arnd@kernel.org/T/#u Signed-off-by: Arnd Bergmann Acked-by: Linus Walleij Acked-by: Sebastian Andrzej Siewior --- I sent a patch to drop HIGHPTE support on x86 today, see https://lore.kernel.org/lkml/20241210144945.2325330-9-arnd@kernel.org/T/#u If that one gets merged, we can merge this one instead of the one that makes HIGHPTE depend on !PREEMPT_RT, but if we decide against the x86 change, then we probably don't want this one either. --- arch/arm/Kconfig | 11 ----------- arch/arm/include/asm/pgalloc.h | 8 +------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 4de4e5697bdf..e132effafd8b 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1229,17 +1229,6 @@ config HIGHMEM If unsure, say n. -config HIGHPTE - bool "Allocate 2nd-level pagetables from highmem" if EXPERT - depends on HIGHMEM && !PREEMPT_RT - default y - help - The VM uses one page of physical memory for each page table. - For systems with a lot of processes, this can use a lot of - precious low memory, eventually leading to low memory being - consumed by page tables. Setting this option will allow - user-space 2nd level page tables to reside in high memory. - config ARM_PAN bool "Enable privileged no-access" depends on MMU diff --git a/arch/arm/include/asm/pgalloc.h b/arch/arm/include/asm/pgalloc.h index a17f01235c29..ef6cb3e6d179 100644 --- a/arch/arm/include/asm/pgalloc.h +++ b/arch/arm/include/asm/pgalloc.h @@ -85,18 +85,12 @@ pte_alloc_one_kernel(struct mm_struct *mm) return pte; } -#ifdef CONFIG_HIGHPTE -#define PGTABLE_HIGHMEM __GFP_HIGHMEM -#else -#define PGTABLE_HIGHMEM 0 -#endif - static inline pgtable_t pte_alloc_one(struct mm_struct *mm) { struct page *pte; - pte = __pte_alloc_one(mm, GFP_PGTABLE_USER | PGTABLE_HIGHMEM); + pte = __pte_alloc_one(mm, GFP_PGTABLE_USER); if (!pte) return NULL; if (!PageHighMem(pte))