From patchwork Tue May 21 02:39:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaewon Kim X-Patchwork-Id: 13668800 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 87239C25B77 for ; Tue, 21 May 2024 02:40:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0F1DF6B0085; Mon, 20 May 2024 22:40:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ECF326B0095; Mon, 20 May 2024 22:40:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 979B26B0096; Mon, 20 May 2024 22:40:16 -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 6A3406B0088 for ; Mon, 20 May 2024 22:40:16 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id F413E160761 for ; Tue, 21 May 2024 02:40:15 +0000 (UTC) X-FDA: 82140848790.05.62FF3CD Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by imf20.hostedemail.com (Postfix) with ESMTP id 2D73C1C000D for ; Tue, 21 May 2024 02:40:12 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=d0TkNevH; spf=pass (imf20.hostedemail.com: domain of jaewon31.kim@samsung.com designates 203.254.224.25 as permitted sender) smtp.mailfrom=jaewon31.kim@samsung.com; dmarc=pass (policy=none) header.from=samsung.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716259213; a=rsa-sha256; cv=none; b=SWFIBLgaXHIgMXGBLAT8QsgfcwEm89L7dyT6lYziQp6p/fYmtszS///8ppQwWXTCfX/qJ5 r/k599U4sfiunCyxlK1pZgM7auMSlA8ZMTNlA5t/SaV78jt6Fyhn06CEiKR1fLsEAT5Idg QigkaePqzK8zVV9QCmk/e40J/MNsPXk= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=d0TkNevH; spf=pass (imf20.hostedemail.com: domain of jaewon31.kim@samsung.com designates 203.254.224.25 as permitted sender) smtp.mailfrom=jaewon31.kim@samsung.com; dmarc=pass (policy=none) header.from=samsung.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1716259213; 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: references:references:dkim-signature; bh=2nyw+C7rNp+l+xPXOp2Qx9L1AYg4BMnfedd/ZCD1HbI=; b=AUAQKg9HBUMLgul+DAHLNuzxNb3Y7HqdfM1m3OJkUoFVMJFl7FZxCRi2DoOKWQfIOilRLf lg+pMLwCeYD080ii1ltKPcXZj5pzkBiTtGFYvCxuBG0vlx9lgRKfDs5J3FzAjzZEvUg75o NelRb1nu2sCC9XndiLlerkiubpEt8DQ= Received: from epcas1p3.samsung.com (unknown [182.195.41.47]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20240521024009epoutp0203d714d6af49bb096bf7cac07971cd45~RYKiCjJwv0461604616epoutp02A for ; Tue, 21 May 2024 02:40:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20240521024009epoutp0203d714d6af49bb096bf7cac07971cd45~RYKiCjJwv0461604616epoutp02A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1716259209; bh=2nyw+C7rNp+l+xPXOp2Qx9L1AYg4BMnfedd/ZCD1HbI=; h=From:To:Cc:Subject:Date:References:From; b=d0TkNevH/IoRRNxgwwDjwDYCC+/vfpmLafl5e3MK5oXvUsvWPWO4gg5P680j5z/DU vDu9JLC7lIcrjQAaQxptcnfbniIlcS5cCXmWViuoBzkeUnrr7A9M9yyKy3Swde4coQ E65uJbTy2MnfvyyJ5bGpFoiE5BH8XKHBczp1xqhc= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20240521024009epcas1p2b2862f74e82056485388c1927517d774~RYKhps6ou0671506715epcas1p2w; Tue, 21 May 2024 02:40:09 +0000 (GMT) Received: from epsmges1p5.samsung.com (unknown [182.195.36.227]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4VjzDn2YPRz4x9Pq; Tue, 21 May 2024 02:40:09 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p5.samsung.com (Symantec Messaging Gateway) with SMTP id AE.B2.10076.9890C466; Tue, 21 May 2024 11:40:09 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas1p1.samsung.com (KnoxPortal) with ESMTPA id 20240521024009epcas1p10ed9f9b929203183a29f79508e79bb76~RYKhQBRoC2349123491epcas1p1Z; Tue, 21 May 2024 02:40:09 +0000 (GMT) Received: from epsmgmc1p1new.samsung.com (unknown [182.195.42.40]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240521024009epsmtrp2f02cd063e59c1418c1cdcf0d843f09e4~RYKhO8aTB2496124961epsmtrp2m; Tue, 21 May 2024 02:40:08 +0000 (GMT) X-AuditID: b6c32a39-59dff7000000275c-c5-664c0989c64a Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgmc1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id BD.EA.09238.8890C466; Tue, 21 May 2024 11:40:08 +0900 (KST) Received: from localhost.localdomain (unknown [10.253.104.99]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20240521024008epsmtip2f022c4301ade9151768656be3085c125~RYKhF2BnR1132711327epsmtip2Q; Tue, 21 May 2024 02:40:08 +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, jaewon31.kim@gmail.com, Jaewon Kim Subject: [RESEND PATCH 00/10] memblock: introduce memsize showing reserved memory Date: Tue, 21 May 2024 11:39:47 +0900 Message-Id: <20240521023957.2587005-1-jaewon31.kim@samsung.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrNKsWRmVeSWpSXmKPExsWy7bCmrm4np0+aweTpghZz1q9hs+jePJPR ovf9KyaLy7vmsFncW/Of1eLI+u1MFrMb+xgd2D12zrrL7rFpVSebx6ZPk9g9Tsz4zeLRt2UV o8eZBUfYPT5vkgtgj8q2yUhNTEktUkjNS85PycxLt1XyDo53jjc1MzDUNbS0MFdSyEvMTbVV cvEJ0HXLzAE6SEmhLDGnFCgUkFhcrKRvZ1OUX1qSqpCRX1xiq5RakJJTYFagV5yYW1yal66X l1piZWhgYGQKVJiQnbH7x2vGgk3CFTM+X2BpYNzP18XIySEhYCIx5cxvli5GLg4hgR2MEivW fmaFcD4xSjybcIkJwvnGKDH9/h8ghwOs5etDcYj4XkaJGyv3Q7V/ZpQ4fXQzK8hcNgFtifcL JoHZIgJ2Et9mHwCzmQVKJd6+OcEMYgsLBEssOHSHEcRmEVCV+LjpCROIzStgL7H+6Go2iPvk JWZe+s4OEReUODnzCQvEHHmJ5q2zmUEWSwjcYpd4Ob+JEaLBReLdyzZ2CFtY4tXxLVC2lMTn d3uhhuZLXLj4CuqbGomFEw0hwvYSu77OYAUJMwtoSqzfpQ+xik/i3dceVohqXomONiGIajWJ lmdfWSFsGYm//55B2R4Sd6/tZgEpFxKIlTh8wWACo9wsJPfPQnL/LIRdCxiZVzGKpRYU56an FhsWmMKjMTk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WpBbBZJk4OKUamMKbLRaIiDtk2U6o+HmVc6l2+zXl7UyuCT/v Fx3eXx1wtsQ+7buN807z/OxnHJp3W+1lsrhVNYLu1ejaV7nK/ebJya6NWvmPYQFvJVNg6pPO iE3Nc+bw1dxzlG5c23/00abp5f4aW5l9uJRnu8+7LKTMpp/qeyZGL8PFsnGVczyHh+aMs4qR kgIM75T9JfmnrPGXXOZU7jJRN6D/v/aXU2WibysO/n8r9fH7obfrDvsekviuVbO8ZNGu9LbE GC8WscJ/z1Ydcv3k+HFO+Grz3cFnyp4/WR20PbJk9Ue1Z9nPOdTjmH5MnTKt51flR+N1DWdT ixcuZtSUbeu7+vMs741ZDp6rNX+35D0P+rNEiaU4I9FQi7moOBEAjXhfpMoCAAA= X-CMS-MailID: 20240521024009epcas1p10ed9f9b929203183a29f79508e79bb76 X-Msg-Generator: CA CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20240521024009epcas1p10ed9f9b929203183a29f79508e79bb76 References: X-Rspamd-Queue-Id: 2D73C1C000D X-Rspam-User: X-Rspamd-Server: rspam12 X-Stat-Signature: 18778dh9qrz5gckxw15c9ykejstmdb5g X-HE-Tag: 1716259212-174285 X-HE-Meta: U2FsdGVkX18XaTnZVNmDGRImiyu56wjE+0x1Ij0LSBuPIqQTPw0IrfwBkcU1eVbdjjNnnHrmRaGpBVq0u3RoieXj1yTtz9pMUCnok61ds+MsVum2QZ1HKHFD/+hUz5hOl0KZjbvKyPItp/Q1wHyOyH32tkrwScullv0uJKP+CmGq1K0zqoOxJKsVgV6TzwATSu2OjcHj4SYhVrr73hsXJNQd3MMhrsQAOhp/F3lbwWcNrZA5FfC5zcfjl29Nq3k3nTZV9zNaGxRAEVhagZmK9jypTDJttGYMbdei71Fy99aDyzCsoTdBBlCf/GhJLoVYhiITSGZMQkRTk5CsQvxcD4xMKXe9lWJsW7ek9EWrcx/n0Nc5eokVGkr/nCtxWpG62e48qtDrMq+S5ccp1aToc7K5E+5IqfU6C8O9Niv+1IfU9347eocL/gyxRrl1S1QxgZP7Ev9qVIr7/3mwgl732gXMMKoeL0ITKtUUO42WtNob0rIg/jmcXakhau+tA39BG7u5jkBmnWtmBUh7PEJaxENk55fxyY4RhigVNfF57kKSGy1AsDGsrbcVU/1IqMl2hcKjFYF45U1TR86BGDt18ZHxd2iRVWIDFWUCuG0zoLxxBJZ0Ji+OAN/LUENaSJZi2ZLP4/u/UO1U9Hb/lrgrCKZ5vV1nAAgjesV3qhxeW0gRHvdOEim6rQlUCQIWbYLhAeEyzZZJym3Y/kM+rwQ8JspZQwjv1hS7gYGWOQvzqYbYvw6+g2uMOKA8XzBdTrnJsORkFA4pNZliDdC5fVcqWLOYsXJfBWiRqG+11NqLLF77ts97VZMKFFlTcWXg2LkYfVYIKOizlHj7up+HTJf9Sp9Tt/Q94nrZRVLCnnDRCBerK8y+nk0tLMqP0n81on9e0Ig6llTlm0oNbia1nzI58YVZ6t67A6+4A2AMhm1IXxqSE2c+CBPwTBPJOujc4Wa/g7IDqff5veVA1ZcXAkb KPNpiFvM IxV4g4zYXO9kocGMtCLuSrJ8kpRahctGvWTTe9isDiPGZe9+PAsVC27ZiOBhQDacWtpDQXI6fm4egDns/BUVrGsKF2DMITmiTbT4n4FAhnxCyoocFj7sggTVMCNwaHwE94xN5FRh1mb1Mnxfb+A7JMNIoorpq3ss8lT4H 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: 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 0x0000000000000000-0x0000000000000000 0x02000000 ( 32768 KB ) map reusable linux,cma 0x0000000000000000-0x0000000000000000 0x01000000 ( 16384 KB ) map reusable vxxxxx ... 0x0000000000000000-0x0000000000000000 0x004e0000 ( 4992 KB ) nomap unusable unknown 0x0000000000000000-0x0000000000000000 0x00400000 ( 4096 KB ) nomap unusable cxxxxx 0x0000000000000000-0x0000000000000000 0x00e00000 ( 14336 KB ) nomap unusable gxxxxx Reserved : 1223856 KB .kernel : 275208 KB .text : 16576 KB .rwdata : 1963 KB .rodata : 11920 KB .bss : 2450 KB .memmap : 186368 KB .etc : 55933 KB .unusable : 948648 KB System : 11359056 KB .common : 10306384 KB .reusable : 1052672 KB Total : 12582912 KB ( 12288.00 MB ) Jaewon Kim (10): memblock: introduce memsize showing reserved memory memblock: detect hidden memory hole size memblock: handle overlapped reserved memory region memblock: take a region intersecting an unknown region memblock: track memblock changed at early param memblock: recognize late freed size by checking PageReserved memblock: track kernel size on memsize memblock: print memsize summary information memblock: print kernel internal size memblock: support memsize reusable to consider as reusable drivers/of/fdt.c | 11 + drivers/of/of_reserved_mem.c | 12 +- include/linux/memblock.h | 29 ++ init/main.c | 13 +- kernel/dma/contiguous.c | 9 +- mm/Kconfig | 16 ++ mm/memblock.c | 502 ++++++++++++++++++++++++++++++++++- mm/mm_init.c | 6 +- mm/page_alloc.c | 10 +- 9 files changed, 597 insertions(+), 11 deletions(-)