From patchwork Sun Mar 19 21:59:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 13180629 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 B48DEC6FD1F for ; Sun, 19 Mar 2023 22:00:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E0718900003; Sun, 19 Mar 2023 18:00:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DB6B1900002; Sun, 19 Mar 2023 18:00:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C7E42900003; Sun, 19 Mar 2023 18:00:28 -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 B7A01900002 for ; Sun, 19 Mar 2023 18:00:28 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 7C6DFA0486 for ; Sun, 19 Mar 2023 22:00:28 +0000 (UTC) X-FDA: 80587017336.20.F45DD85 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf21.hostedemail.com (Postfix) with ESMTP id 645691C0018 for ; Sun, 19 Mar 2023 22:00:25 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="Kk5f+/gw"; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf21.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1679263225; 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:references:dkim-signature; bh=SlngXS0WBORh0zxzA19Q7DsQCeUUUadjDsC9kvrqVRk=; b=TB9oucbgjM7qEiHaoGC1A6nq92AU+xIp2iXbHKMqWD3l+LJao3BVh/eGvpiyDfjyt4xVYF x/i92ilInlHThUGzvy80pLNMtNwV7Ofl9Rmc//PqLbPjSZgRx32dONsmPCnf08sOnYCPXx ULXy9TJP6thpprT85zz0XomPczmLoAs= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="Kk5f+/gw"; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf21.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1679263225; a=rsa-sha256; cv=none; b=w51Y/05P7K0Z4wtyv/jcFbngvXudHm/K0lPrORWpmZfpziK5R6YJ+5T5m7UJjin+wd/c/X aVlc9b5F2nLZOrQXLVaNoKkzQLHVtUsEICIC8L4y6LqQuzCGYhQqL/RF731wy6PHikfo7A JnNVvhH5Ezbu7rMaGCFHNuyUp28NaTU= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8CE65B80D29; Sun, 19 Mar 2023 22:00:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24974C433D2; Sun, 19 Mar 2023 22:00:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679263222; bh=n5dARZfFatcR/h3JAA/9fYzmvZk45a19M/lZTBw1xvI=; h=From:To:Cc:Subject:Date:From; b=Kk5f+/gwsjcbiOO1/wCvoyl4Anptv1hWH8xJESI5zcw3p2CsjLWtDdmR9QdQM+3LJ 48ck9Nbm7HCsv1BIhG0z68FKMnc+paUE4nNp8CBGtz2wXTUGG4xufiBddp5daENesA FQveh29Cd8GoMFH5KgVOfc/xAYlta53sbHuynvA2gW4zAcVZzL1Q+M2DEKtPvBBV59 yQHCYCnIbS95lr+op+v93shUF7mcTAU5sabWijpg3+CfGSUEuAmbmMW/Y0uf2fPUD1 yLw4uhA7DGldAgR2Rjl/gSBJw2t+xBv4/+fuSE7ivbtFZ//GlqgeEG925HAm/9hBOl 99zYcrRdV3eEg== From: Mike Rapoport To: Andrew Morton Cc: David Hildenbrand , Matthew Wilcox , Mel Gorman , Michal Hocko , Mike Rapoport , Thomas Bogendoerfer , Vlastimil Babka , linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 00/15] mm: move core MM initialization to mm/mm_init.c Date: Sun, 19 Mar 2023 23:59:53 +0200 Message-Id: <20230319220008.2138576-1-rppt@kernel.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 645691C0018 X-Stat-Signature: oo6dk43ozq4qhsqsah8ax6fk4a9s3nxa X-HE-Tag: 1679263225-189326 X-HE-Meta: U2FsdGVkX19N6iubIoEDDy2JQnKUeRHGKeR7xIvakSsXrAltdSd7t8AVvbKJoFZ1Ugtst6Ku4PJ6sFLNHW1fLEQ3hXzrgjWPW3Kx41NktkseI6mJbYbkLN0JgckuLzRWMrFLuD66mjiA2aXES982qBIYHZqd//zpCwfJiOOnXlv4P0nFe76uaIY7zg6GP77kuXxiU/dGU2LMypmW7C1zptA2mBav1fYT1wZD0le2DA1LKMQ9BDYvMdl4ZQCBU7YS3zkVrGgKoJIkKgTszP7EdzPiNtD+ul8hxqQ/NlaVjf9q+lljuZlYGTmw1jW+c+ucrUw7ZIIe4cYQxDJNPs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icity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: "Mike Rapoport (IBM)" Also in git: https://git.kernel.org/rppt/h/mm-init/v1 This set moves most of the core MM initialization to mm/mm_init.c. This largely includes free_area_init() and its helpers, functions used at boot time, mm_init() from init/main.c and some of the functions it calls. Aside from gaining some more space before mm/page_alloc.c hits 10k lines, this makes mm/page_alloc.c to be mostly about buddy allocator and moves the init code out of the way, which IMO improves maintainability. Besides, this allows to move a couple of declarations out of include/linux and make them private to mm/. And as an added bonus there a slight decrease in vmlinux size. For tinyconfig and defconfig on x86 I've got tinyconfig: text data bss dec hex filename 853206 289376 1200128 2342710 23bf36 a/vmlinux 853198 289344 1200128 2342670 23bf0e b/vmlinux defconfig: text data bss dec hex filename 26152959 9730634 2170884 38054477 244aa4d a/vmlinux 26152945 9730602 2170884 38054431 244aa1f b/vmlinux Mike Rapoport (IBM) (15): mips: fix comment about pgtable_init() mm/cma: move init_cma_reserved_pages() to cma.c and make it static mm/page_alloc: add helper for checking if check_pages_enabled mm: move most of core MM initialization to mm/mm_init.c mm: handle hashdist initialization in mm/mm_init.c mm/page_alloc: rename page_alloc_init() to page_alloc_init_cpuhp() init: fold build_all_zonelists() and page_alloc_init_cpuhp() to mm_init() init,mm: move mm_init() to mm/mm_init.c and rename it to mm_core_init() mm: move pgtable_init() to mm/mm_init.c and make it static mm: move init_mem_debugging_and_hardening() to mm/mm_init.c init,mm: fold late call to page_ext_init() to page_alloc_init_late() mm: move mem_init_print_info() to mm_init.c mm: move kmem_cache_init() declaration to mm/slab.h mm: move vmalloc_init() declaration to mm/internal.h MAINTAINERS: extend memblock entry to include MM initialization MAINTAINERS | 3 +- arch/mips/include/asm/fixmap.h | 2 +- include/linux/gfp.h | 7 +- include/linux/mm.h | 9 +- include/linux/page_ext.h | 2 - include/linux/slab.h | 1 - include/linux/vmalloc.h | 4 - init/main.c | 74 +- mm/cma.c | 21 + mm/internal.h | 45 + mm/mm_init.c | 2532 +++++++++++++++++++++++++++ mm/page_alloc.c | 2981 +++----------------------------- mm/slab.h | 1 + 13 files changed, 2855 insertions(+), 2827 deletions(-) base-commit: 4018ab1f7cec061b8425737328edefebdc0ab832