Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1145827pxb; Thu, 24 Mar 2022 13:43:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4Wc4XQoX3iLYHQsWOgIntCCbTMOfdLIt7srIIQhS7RBy61eQWE1aqtFxp/8lcwb2vRZpx X-Received: by 2002:a17:902:6845:b0:153:9af1:3134 with SMTP id f5-20020a170902684500b001539af13134mr7805188pln.169.1648154612801; Thu, 24 Mar 2022 13:43:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648154612; cv=none; d=google.com; s=arc-20160816; b=mG2MFwvvvHD2l/bcZKjs8OAmQpYmO08jttc1W5xZ5yp5UTiIHjz3dUsnXK0vIJczMR 5XG3dBKRHnh2cUq1iS4I3I5HpzaHcZlakV6qS2cTVXcVF46k1aPfzCLIlhCf770VQwBG /P1AAGaLYZKBaVV917P2py15Nu2KMmzvCTAw8Dxo32wRFteL7FPfKtIviR7mO2hAyJdL 96D2pV2KxmuG/WWG2BEFGbi5djl1yG9aQyCAK3oKEwUu/AwlUGhxGXaC9Tnllq6pxMvz zzC68jr2Jf8L6niBySpAsZGx7BrqwuSh9/ljx+KeKRgN9+eDyNKDjPBpny0UgqUiNKhs NskQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=95OQZnrTneCPsp9i8C5Lny3QhxwLFEspWNR3e8e8ZVU=; b=GGimrCrQ5gaiCsTiy8+LpUWYmbiBgjUBKBPPoLVu+Tl0Sc9fcp9nPbe2yhT5GGIYYe Vxu4ftpUJrxMMOrfKbYL5yp9QRQ7Pb4eCF1/wq28ErhzwywaB9BxvLUT18ZSxQsQDDvK 5Cl3bpeK1bS2kdCpdZ+jPNPb22fINn49lxw4gXzo1e2KY34dnWhcTvd5xFj8rPMm4HAJ SZw6TopaOvOVB5jlkOhZqG3kDrR1Fvx3BEzMEIrCT7d5U3h/qk/vsrHoCeXOpwLMczOz e+lR+0gK4bU2KSS/88394DfC6mRf2cC66HMQ0rZygzojzT3J6BFFoxWUhC493G7ldQjq CXcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=HagKM6Wr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oo15-20020a17090b1c8f00b001c6b6b1c91bsi4573481pjb.7.2022.03.24.13.43.18; Thu, 24 Mar 2022 13:43:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=HagKM6Wr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348334AbiCXHBT (ORCPT + 99 others); Thu, 24 Mar 2022 03:01:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244643AbiCXHA7 (ORCPT ); Thu, 24 Mar 2022 03:00:59 -0400 Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4DF153A6C for ; Wed, 23 Mar 2022 23:59:25 -0700 (PDT) Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20220324065921epoutp02ed26e69bd9e19f46bd5bcd9952d416af~fPulyEFtU1428414284epoutp02Z for ; Thu, 24 Mar 2022 06:59:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20220324065921epoutp02ed26e69bd9e19f46bd5bcd9952d416af~fPulyEFtU1428414284epoutp02Z DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1648105161; bh=95OQZnrTneCPsp9i8C5Lny3QhxwLFEspWNR3e8e8ZVU=; h=From:To:Cc:Subject:Date:References:From; b=HagKM6WrTTuwwPyZVkXRcNFWLF5hTixc7QfWwMTkQYAo0oduCMrUCmQT2dagESDFc Zzp1OYsipq1jdqk2IrfHqrHWhHMupWdLJCBGqW0CRbPMunyVZNn6EClimhrEHHiQTX nULRcNJwJp8fHsgtLjbCgCGGlzss0KHWPV+Xt0Ug= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20220324065920epcas1p39792ec7e377ccdb4b370be9bbfeabf6e~fPulS71bP0539605396epcas1p3i; Thu, 24 Mar 2022 06:59:20 +0000 (GMT) Received: from epsmges1p5.samsung.com (unknown [182.195.38.249]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4KPGKz4LG9z4x9Q5; Thu, 24 Mar 2022 06:59:19 +0000 (GMT) Received: from epcas1p3.samsung.com ( [182.195.41.47]) by epsmges1p5.samsung.com (Symantec Messaging Gateway) with SMTP id 40.2B.28648.7C61C326; Thu, 24 Mar 2022 15:59:19 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p4.samsung.com (KnoxPortal) with ESMTPA id 20220324065919epcas1p4c79da5f6ec4fa0311409ca24a38785d8~fPukM222e2260522605epcas1p4m; Thu, 24 Mar 2022 06:59:19 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20220324065919epsmtrp119bc2f245fb329c59bc753673a59aeb7~fPukMDP2S2225322253epsmtrp1N; Thu, 24 Mar 2022 06:59:19 +0000 (GMT) X-AuditID: b6c32a39-ff1ff70000006fe8-89-623c16c79c3f Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id C5.AD.03370.7C61C326; Thu, 24 Mar 2022 15:59:19 +0900 (KST) Received: from jaewon-linux.10.32.193.11 (unknown [10.253.100.104]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20220324065919epsmtip2346e3a1312333e5561c4704fa10f56b6~fPukDaeDs3187231872epsmtip2a; Thu, 24 Mar 2022 06:59:19 +0000 (GMT) From: Jaewon Kim To: rppt@kernel.org, vbabka@suse.cz, akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, ytk.lee@samsung.com, jaewon31.kim@gmail.com, Jaewon Kim Subject: [PATCH 0/8] memblock: introduce memsize showing reserved memory Date: Thu, 24 Mar 2022 16:01:50 +0900 Message-Id: <20220324070158.22969-1-jaewon31.kim@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrNKsWRmVeSWpSXmKPExsWy7bCmvu5xMZskg02tShZz1q9hs+jePJPR ovf9KyaLy7vmsFncW/Of1eLI+u1MFrMb+xgtHq/nduDw2DnrLrvHplWdbB6bPk1i9zgx4zeL R9+WVYweZxYcYff4vEkugD0q2yYjNTEltUghNS85PyUzL91WyTs43jne1MzAUNfQ0sJcSSEv MTfVVsnFJ0DXLTMH6CglhbLEnFKgUEBicbGSvp1NUX5pSapCRn5xia1SakFKToFZgV5xYm5x aV66Xl5qiZWhgYGRKVBhQnbGjc+LWQv2CVTMPrCdrYGxnaeLkZNDQsBE4tH962xdjFwcQgI7 GCVebTjCCOF8YpTY8nYRO4TzmVFixsSp7DAtcy+ehGrZxSjx/skNVgjnB6PEz69bWEGq2AS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k3px/ytLFyAFkC0scPlwMUfONUaJ53yp2kBo2AW2J 9wsmsYLYIgJOEhuurGYBKWIWmMAosXLZJ7BmYQEPicf9WiA1LAKqEiffHWMCsXkFbCUWrt3G BLFLXmL1hgPMExh5FjAyrGKUTC0ozk3PLTYsMMpLLdcrTswtLs1L10vOz93ECA4wLa0djHtW fdA7xMjEwXiIUYKDWUmE9/5l6yQh3pTEyqrUovz4otKc1OJDjNIcLErivBe6TsYLCaQnlqRm p6YWpBbBZJk4OKUamM5uZz7//92xgLYN5xTtim4oPhQVfsv5yJ6rZZrp+yRfoY/pN84tSLR9 tkWGLb+v7tpLBc4Z1rUHljLI3r204IftzyDukpe7BR/Y7M7OCIqqnLqE65+b+qHtMtYzT7Zf VmyWmrWq6gDPscNeG1juiLG7HtyrWHFeKTiU7bh2pvpZvdjXnmve/50uVeQZsnLLXJ6NoTMD 2E8lci/7fMc929xwx8P0K2fnuLz0PB240E+nOsDoz+pSiedORortp4ui77ztTM3NC7EtqHVY 18zCm33RdedJ9oNsulVseY3zGa737f0b9jtA3uwIh8Wams91Ssys1kyOnI8XL645FDJHK/3a 8Ys/DfSCPOUK5TU3KLEUZyQaajEXFScCABX7qnmfAgAA X-CMS-MailID: 20220324065919epcas1p4c79da5f6ec4fa0311409ca24a38785d8 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20220324065919epcas1p4c79da5f6ec4fa0311409ca24a38785d8 References: X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some of memory regions can be reserved for a specific purpose. They are usually defined through reserved-memory in device tree. If only size without address is specified in device tree, the address of the region will be determined at boot time. We may find the address of the memory regions through booting log, but it does not show all. And it could be hard to catch the very beginning log. The memblock_dump_all shows all memblock status but it does not show region name and its information is difficult to summarize. This patch introduce a debugfs node, memblock/memsize, to see reserved memory easily. Here's an example $ cat debugfs/memblock/memsize 0x0f9000000-0x0fb000000 0x02000000 ( 32768 KB ) map reusable linux,cma 0x0b1900000-0x0b1b00000 0x00200000 ( 2048 KB ) nomap unusable test1 0x0b0200000-0x0b0400000 0x00200000 ( 2048 KB ) map unusable test2 (snipped) Reserved : 746924 KB .kernel : 137027 KB .text : 28158 KB .rwdata : 3238 KB .rodata : 13468 KB .bss : 12570 KB .etc : 79593 KB .unusable : 609897 KB System : 3447380 KB .common : 3152468 KB .reusable : 294912 KB Total : 4194304 KB ( 4096.00 MB ) Jaewon Kim (8): memblock: introduce memsize showing reserved memory memblock: detect hidden memory hole size memblock: handle overlapped reserved memory region memblock: track memblock changed at early param memblock: track kernel size on memsize memblock: recognize late free by checking PageReserved memblock: print memsize summary information memblock: print kernel internal size drivers/of/fdt.c | 10 + drivers/of/of_reserved_mem.c | 7 +- include/linux/memblock.h | 21 ++ include/linux/mm.h | 3 + init/main.c | 13 +- kernel/dma/contiguous.c | 9 +- mm/Kconfig | 7 + mm/memblock.c | 434 ++++++++++++++++++++++++++++++++++- mm/page_alloc.c | 15 +- 9 files changed, 506 insertions(+), 13 deletions(-) -- 2.17.1