From patchwork Tue May 21 02:39:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaewon Kim X-Patchwork-Id: 13668804 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 05124C25B77 for ; Tue, 21 May 2024 02:40:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CD30A6B0098; Mon, 20 May 2024 22:40:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 77E036B008A; Mon, 20 May 2024 22:40:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1B2096B009B; Mon, 20 May 2024 22:40:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id B172B6B0098 for ; Mon, 20 May 2024 22:40:16 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 6EC5FA25BF for ; Tue, 21 May 2024 02:40:16 +0000 (UTC) X-FDA: 82140848832.10.85133BE Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by imf19.hostedemail.com (Postfix) with ESMTP id B9E891A0011 for ; Tue, 21 May 2024 02:40:13 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=cKAiiHkc; dmarc=pass (policy=none) header.from=samsung.com; spf=pass (imf19.hostedemail.com: domain of jaewon31.kim@samsung.com designates 203.254.224.33 as permitted sender) smtp.mailfrom=jaewon31.kim@samsung.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1716259214; 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=BSK9Qlu8VaXXXrgxPdkSNVuJQ8cVVtzS2NFztJ8CnqA=; b=LkiFqRH/r4pecPwnsXuZXf86hpPGTsK+J04I3Olvptr2PP8fAxr5fH7o+dELQ0HLCKlZ5X Ygkd+J8Y91C4X3zjopZ84vlTrsVUmwRudJT8v6MEXhgcX39Kp3htETYTHmHrdEdjHITXWl dkE3Ca/DHjUcADv3W0IjawD/I6eT1nQ= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b=cKAiiHkc; dmarc=pass (policy=none) header.from=samsung.com; spf=pass (imf19.hostedemail.com: domain of jaewon31.kim@samsung.com designates 203.254.224.33 as permitted sender) smtp.mailfrom=jaewon31.kim@samsung.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716259214; a=rsa-sha256; cv=none; b=YWlf914K7NrXYo+/aZaUFsv99ziiUBo4eT+KjnWqJgjPFzX8V7+Dt9vDJomdAIEX1ZlbfF KXgGN0j9hQj+boFAZQwRy+Vzmj0oaIv8ujcYrCJCIWC2nliN7WLvNo8Ks2NdllkY0LxmXB lRfB/JQSW2ykQmeOzU53D/GAkuqHjrc= Received: from epcas1p2.samsung.com (unknown [182.195.41.46]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20240521024010epoutp0350e1726ae347e557edf36ca2d19914dd~RYKi2Cq9-0915109151epoutp03N for ; Tue, 21 May 2024 02:40:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20240521024010epoutp0350e1726ae347e557edf36ca2d19914dd~RYKi2Cq9-0915109151epoutp03N DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1716259210; bh=BSK9Qlu8VaXXXrgxPdkSNVuJQ8cVVtzS2NFztJ8CnqA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cKAiiHkcGQ94RyEZo9XB/RgCZpFSiLysOAf2Hihl96Wt0XQSOpFnzm/kLE4afI/Di Ct14RIE7wrF+hdho0i8/ZsvMrzpbjIRn/XBHf5lGZNbUVOtcCco7IFU0wIE6qmBzoZ v1O2WFuCRI+lmo4bZEALhdKvDHEqUHDHaqNF1+rE= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20240521024010epcas1p2f12c4f8f47d1a12c3d5ab40ebefa4071~RYKiX1IbC0671506715epcas1p24; Tue, 21 May 2024 02:40:10 +0000 (GMT) Received: from epsmges1p1.samsung.com (unknown [182.195.36.223]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4VjzDn5bj4z4x9Pp; Tue, 21 May 2024 02:40:09 +0000 (GMT) Received: from epcas1p4.samsung.com ( [182.195.41.48]) by epsmges1p1.samsung.com (Symantec Messaging Gateway) with SMTP id 30.5F.09662.9890C466; Tue, 21 May 2024 11:40:09 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p2.samsung.com (KnoxPortal) with ESMTPA id 20240521024009epcas1p291bbc11c4e5cdaa922ca302d95330e6b~RYKhpOgNM0129801298epcas1p2p; Tue, 21 May 2024 02:40:09 +0000 (GMT) Received: from epsmgmc1p1new.samsung.com (unknown [182.195.42.40]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20240521024009epsmtrp1a516b7dd01533488b1018c01119b6bb9~RYKhoZ7fg2362723627epsmtrp1L; Tue, 21 May 2024 02:40:09 +0000 (GMT) X-AuditID: b6c32a35-2b3fa700000025be-ab-664c0989e2e9 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgmc1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 3F.EA.09238.9890C466; Tue, 21 May 2024 11:40:09 +0900 (KST) Received: from localhost.localdomain (unknown [10.253.104.99]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20240521024009epsmtip2f1862bf201bde31cc9f190cb892768e6~RYKhfMz3e1132711327epsmtip2V; Tue, 21 May 2024 02:40:09 +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 08/10] memblock: print memsize summary information Date: Tue, 21 May 2024 11:39:55 +0900 Message-Id: <20240521023957.2587005-9-jaewon31.kim@samsung.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240521023957.2587005-1-jaewon31.kim@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupgk+LIzCtJLcpLzFFi42LZdljTQLeT0yfN4O1PNYs569ewWXRvnslo 0fv+FZPF5V1z2CzurfnPanFk/XYmi9mNfYwO7B47Z91l99i0qpPNY9OnSeweJ2b8ZvHo27KK 0ePMgiPsHp83yQWwR2XbZKQmpqQWKaTmJeenZOal2yp5B8c7x5uaGRjqGlpamCsp5CXmptoq ufgE6Lpl5gAdpKRQlphTChQKSCwuVtK3synKLy1JVcjILy6xVUotSMkpMCvQK07MLS7NS9fL Sy2xMjQwMDIFKkzIzjh4ehJrwTu+iofbzrA1MO7j7mLk5JAQMJG4c3MOaxcjF4eQwA5GielH ZjOBJIQEPjFK3PwvAJH4xijxprOZCaaj//xsNojEXkaJ1/2rGSGcz4wSqybMB6tiE9CWeL9g EiuILSJgJ/Ft9gEwm1mgVOLtmxPMILawgKfEsimNYHEWAVWJJ91tjCA2r4C9xJrrlxkhtslL zLz0nR3E5hRwkJg/ZTE7RI2gxMmZT1ggZspLNG+dzQxR/5Vd4ufBFAjbRWLu+rksELawxKvj W9ghbCmJl/1tUHa+xIWLr4Bu5gCyayQWTjSECNtL7Po6gxUkzCygKbF+lz7EJj6Jd197WCGq eSU62oQgq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nFpXnpesn5uZsYwYGupbGD8d78f3qHGJk4GA8xSnAwK4nwbtrimSbE m5JYWZValB9fVJqTWnyIUZqDRUmc13DG7BQhgfTEktTs1NSC1CKYLBMHp1QDk1tBT0nVtl/F H3dOFVoY8uuarfbc7dOlpvnyiru75C968j2tIYL58rye7yYTN4e88HtgsubkPH6dSSEVyi1h h7VDFu2pCnO0/W74tfiqhartZPt0zvyQg2Zs84ojtNWrN8zquflxw+nea/e9jzx9wenz06vz u0yH75qC9hZz+TnMTNnnjq33CFgwseCSTN6L/8G39p5zsWZ/Kj4jMlNX/1nm3RCxVDlG5rXe AWcduW6+vjQ9QTEmR3fh+bXNr6XeLN/Pprr+Mfuf9tMGe349Xfev5OT+efdW9NzmWDQz19tU Xv+aJ6fxhzVXZvfaT+uYuL1APr7hLvvrvfXzYxa6bJzI3B/9XyPqafKzH567UpRYijMSDbWY i4oTAU5uzwzjAgAA X-CMS-MailID: 20240521024009epcas1p291bbc11c4e5cdaa922ca302d95330e6b X-Msg-Generator: CA CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20240521024009epcas1p291bbc11c4e5cdaa922ca302d95330e6b References: <20240521023957.2587005-1-jaewon31.kim@samsung.com> X-Rspamd-Queue-Id: B9E891A0011 X-Stat-Signature: hg3ng5ncrjx5gihhzcd41h9uqsbcfoq8 X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1716259213-239812 X-HE-Meta: U2FsdGVkX18rwdeO0kJ/U6JXs4/GzPL08I1Is3P2Esn3kJsIqFEK3+VshTFsc0ytfcFoCKcG2Ut7hdTJ9cdL02n9RlZ5Mj19cBUnQP2KsLO2B0j+/TATIG2b0dDiMmWeM7RfOzY/gl5/tuX+QLI7xJUfAcrntIEzCjhuNdEoDgStiattMaR3FJ3s12NxrT2aTIaVS8aAVy/sCBbSa8MxpY5EbHNBjdI85ihFuvLOm/oOAzlQczHG8ntKmlaKuYlN3REZ1hZpJxak8a9/uBcSWcz5Bz1sZNcUQwR8bfrosGpoyW1QKwAkU3Vykrp8rHsA2cV5Z0cHUZ3lpx9j7lbMEoTzqIi4ThyDTWEmKAutfAp3DCc731Ll0qTSS6WoTZ92hBWFYIquXKxVgwxhHrZLgQytULP4oNFXI6opYEEoVNitGJd0DWYnsQgF3TjdlwXfHlA6Pf6hC/eOS5hgfl6DTt7ECxxEMp4RJpfh7LjRJJwhtcSp2y6K1paI74HoQ9zWILrXiN7wD36TBaNLDjoX58mn2W0ifGRDkfvpgC9QzH0csurO5W8Q2GeRc5q114J3tqiY+oUmvh9YoXaf+xe1cuqA2wguFSeh34ut2bpddk0Ex7+KF3y4Ppf0b1sQav3TZ0hr+cbjQRm8Q2e9C19nXp8jsAdM5uhjTq65haaSOifYff/xUz4FyICb4mJb6Ne+D9i7TVehOvx1YzfDHa33pAryx829a6/oI0HAcZ8f9uRNg5M58siNlxigBIVo506ZuU10gsVoE5hLWaxFQHgabmQ/ResKVxJiaUdxwcWifrt6N1WzrIGb+yxzjqXpgPjUJFNFTitvhIPQbURJfa9XUNk/OrYZQFreIy49SafJVBj6aGJaKdbx/N9rIKnZxYn2O5xTfT9HF5xBSumu/GG+h9vz9AZ+oAwf8UOUln0Rs8r7iOnbpn5El/WrqgS59lUEfjTX83IdYWfYsUyfAfr HnFwKISO wOkvy5Swla0pVI1DntlFZCvCEXpLUwto3frvLudd69hVqvQ1qLK5AZB/nNX5vLtA4fExA 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: With the previous patches, now we can print summary information. Here's an example of 4GB DRAM device. Reserved : 746924 KB .kernel : 137027 KB .unusable : 609897 KB System : 3447380 KB .common : 3152468 KB .reusable : 294912 KB Total : 4194304 KB ( 4096.00 MB ) Signed-off-by: Jaewon Kim --- mm/memblock.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/mm/memblock.c b/mm/memblock.c index bb033c20ec43..0906d81f66c2 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -2689,7 +2689,8 @@ static int memblock_memsize_show(struct seq_file *m, void *private) { int i; struct memsize_rgn_struct *rgn; - unsigned long reserved = 0, reusable = 0; + unsigned long reserved = 0, reusable = 0, total; + unsigned long system = totalram_pages() << PAGE_SHIFT; sort(memsize_rgn, memsize_rgn_count, sizeof(memsize_rgn[0]), memsize_rgn_cmp, NULL); @@ -2715,13 +2716,24 @@ static int memblock_memsize_show(struct seq_file *m, void *private) reserved += (unsigned long)rgn->size; } + total = memsize_kinit + reserved + system; + seq_puts(m, "\n"); + seq_printf(m, "Reserved : %7lu KB\n", + DIV_ROUND_UP(memsize_kinit + reserved, SZ_1K)); seq_printf(m, " .kernel : %7lu KB\n", DIV_ROUND_UP(memsize_kinit, SZ_1K)); seq_printf(m, " .unusable : %7lu KB\n", DIV_ROUND_UP(reserved, SZ_1K)); + seq_printf(m, "System : %7lu KB\n", + DIV_ROUND_UP(system, SZ_1K)); + seq_printf(m, " .common : %7lu KB\n", + DIV_ROUND_UP(system - reusable, SZ_1K)); seq_printf(m, " .reusable : %7lu KB\n", DIV_ROUND_UP(reusable, SZ_1K)); + seq_printf(m, "Total : %7lu KB ( %5lu.%02lu MB )\n", + DIV_ROUND_UP(total, SZ_1K), + total >> 20, ((total % SZ_1M) * 100) >> 20); return 0; }