From patchwork Mon Mar 25 14:56:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 13602381 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 0F030C54E58 for ; Mon, 25 Mar 2024 14:57:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9ABA26B00AC; Mon, 25 Mar 2024 10:57:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 95D626B00AD; Mon, 25 Mar 2024 10:57:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7FC9D6B00AE; Mon, 25 Mar 2024 10:57:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 6C54A6B00AC for ; Mon, 25 Mar 2024 10:57:48 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 12BF81403BC for ; Mon, 25 Mar 2024 14:57:48 +0000 (UTC) X-FDA: 81935865816.01.FDF101A Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf09.hostedemail.com (Postfix) with ESMTP id 2D036140020 for ; Mon, 25 Mar 2024 14:57:45 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=g1T9Ehuw; spf=pass (imf09.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711378666; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=5/dwNQotPOuDzP94j8tfuuqXGBTyVS8xmsMLBZwx3Fc=; b=k0x7fGZN+HNJzVEuZD6MG9UbfrvBkdGhcVWOpRAoWVTQUzuLrojVaqxZE+lGxEYYY1Zxjc CVeOBkRpuask9JWb9JP1fC5quw0De3QQVXWOKh4/Cr3Foh5IGGkT+00J4cl77Gvn4YmalR perwwJay2anY/VEVENyomD5D4KbIEnA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711378666; a=rsa-sha256; cv=none; b=r+3tFFc5WxWsz5SWp2eXnkuFSvgt7F9euQFqsaq0Bi58WHpojsL7UnNPJJe7H0vtgOxnTy qgDJ/z6CIH/jSE2X7d/5AiaFZ/4Or0Z7ZV2eK/DhqNmzaax2M7KGMBQ0+94TnP+9vrWr7Q vMyPWDJRDxsaOuAlbGCFW4P/53LRhTM= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=g1T9Ehuw; spf=pass (imf09.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711378665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5/dwNQotPOuDzP94j8tfuuqXGBTyVS8xmsMLBZwx3Fc=; b=g1T9EhuwMSRjTBrSWmBZpDLZs/o2p9lmul3gDhJ8vDE0WbJ8HSZaHoJWQhiRwyE3GysgpZ xYLYtRjuu5E4DgFheFieDMGHfTwbNSzVioOYeXAqD58T80mW4anflRxQImtTAwDMw29MQd rz8WTtXWx1ddXcQUta4UNzGdIVF1IF8= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-344-JOnOfEttPF6UEAmFRgPLYw-1; Mon, 25 Mar 2024 10:57:41 -0400 X-MC-Unique: JOnOfEttPF6UEAmFRgPLYw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B01963811F22; Mon, 25 Mar 2024 14:57:40 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (unknown [10.72.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id D62983C22; Mon, 25 Mar 2024 14:57:37 +0000 (UTC) From: Baoquan He To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, x86@kernel.org, linuxppc-dev@lists.ozlabs.org, akpm@linux-foundation.org, rppt@kernel.org, Baoquan He Subject: [PATCH v2 6/6] mm/mm_init.c: remove arch_reserved_kernel_pages() Date: Mon, 25 Mar 2024 22:56:46 +0800 Message-ID: <20240325145646.1044760-7-bhe@redhat.com> In-Reply-To: <20240325145646.1044760-1-bhe@redhat.com> References: <20240325145646.1044760-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Rspamd-Queue-Id: 2D036140020 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: cgmjuxs14bpda8ozod4y313k6k39tnce X-HE-Tag: 1711378665-149290 X-HE-Meta: U2FsdGVkX1/E5lx4LK2bxAodToLU/h8cp29GK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tdS1qj2XY1LVwvlmujzde/ni9MnJ7ZQrC7Amkcw/BSxfEAEUhV28MBmtYlhN8awV60QM4P6YZoLfTE8Wn7HBBw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Since the current calculation of calc_nr_kernel_pages() has taken into consideration of kernel reserved memory, no need to have arch_reserved_kernel_pages() any more. Signed-off-by: Baoquan He Reviewed-by: Mike Rapoport (IBM) Reviewed-by: Mike Rapoport (IBM) --- arch/powerpc/include/asm/mmu.h | 4 ---- arch/powerpc/kernel/fadump.c | 5 ----- include/linux/mm.h | 3 --- mm/mm_init.c | 12 ------------ 4 files changed, 24 deletions(-) diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h index 3b72c7ed24cf..aa5c0fd5edb1 100644 --- a/arch/powerpc/include/asm/mmu.h +++ b/arch/powerpc/include/asm/mmu.h @@ -406,9 +406,5 @@ extern void *abatron_pteptrs[2]; #include #endif -#if defined(CONFIG_FA_DUMP) || defined(CONFIG_PRESERVE_FA_DUMP) -#define __HAVE_ARCH_RESERVED_KERNEL_PAGES -#endif - #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_MMU_H_ */ diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c index d14eda1e8589..ae8c7619e597 100644 --- a/arch/powerpc/kernel/fadump.c +++ b/arch/powerpc/kernel/fadump.c @@ -1735,8 +1735,3 @@ static void __init fadump_reserve_crash_area(u64 base) memblock_reserve(mstart, msize); } } - -unsigned long __init arch_reserved_kernel_pages(void) -{ - return memblock_reserved_size() / PAGE_SIZE; -} diff --git a/include/linux/mm.h b/include/linux/mm.h index ad19350e1538..ab1ba0a31429 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -3221,9 +3221,6 @@ static inline void show_mem(void) extern long si_mem_available(void); extern void si_meminfo(struct sysinfo * val); extern void si_meminfo_node(struct sysinfo *val, int nid); -#ifdef __HAVE_ARCH_RESERVED_KERNEL_PAGES -extern unsigned long arch_reserved_kernel_pages(void); -#endif extern __printf(3, 4) void warn_alloc(gfp_t gfp_mask, nodemask_t *nodemask, const char *fmt, ...); diff --git a/mm/mm_init.c b/mm/mm_init.c index e269a724f70e..089dc60159e9 100644 --- a/mm/mm_init.c +++ b/mm/mm_init.c @@ -2373,17 +2373,6 @@ void __init page_alloc_init_late(void) page_alloc_sysctl_init(); } -#ifndef __HAVE_ARCH_RESERVED_KERNEL_PAGES -/* - * Returns the number of pages that arch has reserved but - * is not known to alloc_large_system_hash(). - */ -static unsigned long __init arch_reserved_kernel_pages(void) -{ - return 0; -} -#endif - /* * Adaptive scale is meant to reduce sizes of hash tables on large memory * machines. As memory size is increased the scale is also increased but at @@ -2426,7 +2415,6 @@ void *__init alloc_large_system_hash(const char *tablename, if (!numentries) { /* round applicable memory size up to nearest megabyte */ numentries = nr_kernel_pages; - numentries -= arch_reserved_kernel_pages(); /* It isn't necessary when PAGE_SIZE >= 1MB */ if (PAGE_SIZE < SZ_1M)