From patchwork Tue Jun 28 09:45:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dennis Chen X-Patchwork-Id: 9202417 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3BD5D60757 for ; Tue, 28 Jun 2016 09:46:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2AE61285D0 for ; Tue, 28 Jun 2016 09:46:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1EC7F285F9; Tue, 28 Jun 2016 09:46:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 119D4285D0 for ; Tue, 28 Jun 2016 09:46:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752358AbcF1JqW (ORCPT ); Tue, 28 Jun 2016 05:46:22 -0400 Received: from eu-smtp-delivery-143.mimecast.com ([146.101.78.143]:37489 "EHLO eu-smtp-delivery-143.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752370AbcF1JqR convert rfc822-to-8bit (ORCPT ); Tue, 28 Jun 2016 05:46:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=PlQZL9ouhy+eg+GRJQzQu9aN1+IfDEzLzX52DgNz8oM=; b=KwHJ+kWliqvnRNzJG6fJ8j25HCNQ+YYm+qL92Cy0y9CTOAh1IO4AOygpHQO5DhIqpBaDN264Bh9NCK8+TnFFVCqW33Ao/W1Pb52Ovv2KHG2dD0B0qd/5VHTyJ2EXgsrldV8lkIyoIz/s2bx3S0dvU3XqBMBDLx5GsZSr3G+aHw4= Received: from emea01-am1-obe.outbound.protection.outlook.com (mail-am1lrp0020.outbound.protection.outlook.com [213.199.154.20]) (Using TLS) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-33-rRt1o28hNvOzbd_q3paSrA-1; Tue, 28 Jun 2016 10:46:13 +0100 Received: from AM2PR08CA0006.eurprd08.prod.outlook.com (10.162.32.16) by AM4PR0801MB1522.eurprd08.prod.outlook.com (10.168.5.148) with Microsoft SMTP Server (TLS) id 15.1.523.12; Tue, 28 Jun 2016 09:46:11 +0000 Received: from DB3FFO11FD053.protection.gbl (2a01:111:f400:7e04::102) by AM2PR08CA0006.outlook.office365.com (2a01:111:e400:843e::16) with Microsoft SMTP Server (TLS) id 15.1.528.16 via Frontend Transport; Tue, 28 Jun 2016 09:46:12 +0000 Received: from nebula.arm.com (217.140.96.140) by DB3FFO11FD053.mail.protection.outlook.com (10.47.217.125) with Microsoft SMTP Server (TLS) id 15.1.523.9 via Frontend Transport; Tue, 28 Jun 2016 09:46:11 +0000 Received: from dennis-ws.asiapac.arm.com (10.1.2.79) by mail.arm.com (10.1.106.66) with Microsoft SMTP Server id 14.3.294.0; Tue, 28 Jun 2016 10:46:01 +0100 From: Dennis Chen To: CC: , Dennis Chen , Catalin Marinas , Steve Capper , "Ard Biesheuvel" , Will Deacon , Mark Rutland , "Rafael J . Wysocki" , Matt Fleming , , , Subject: [PATCH v4 1/3] mm: memblock enhence the memblock debugfs output Date: Tue, 28 Jun 2016 17:45:35 +0800 Message-ID: <1467107137-29631-1-git-send-email-dennis.chen@arm.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:217.140.96.140; IPV:CAL; SCL:-1; CTRY:GB; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(438002)(189002)(199003)(86362001)(33646002)(50986999)(575784001)(50466002)(4326007)(8936002)(106466001)(50226002)(189998001)(77096005)(356003)(48376002)(47776003)(246002)(8676002)(305945005)(7696003)(36756003)(19580395003)(26826002)(5003940100001)(6806005)(229853001)(104016004)(110136002)(7846002)(5003600100003)(87936001)(19580405001)(92566002)(2906002)(586003)(2351001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR0801MB1522; H:nebula.arm.com; FPR:; SPF:Pass; PTR:fw-tnat.cambridge.arm.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DB3FFO11FD053; 1:jDihJ5ukxIsKT5iX/kaDlVXYhuZpKbbaA0h8WUJcknarQj2t5cECcK+W1w+w3m7QkRzT1YljUIEsL5vhKwwITS26/f3VbVHFVfGm7ymhs4Yq1Ar7QOnSQliTx/GY3wYFD6wq5aeJ0hPtgfqKpe+XmRKsWgWhzKQdvL+tij+uMiMtx2lF8Tq64AnClxTVqOB1pUtxCbK3UA+XWL7P0ksQP9g1VTS9DmG7S5/1yvH2QIxf+4pT+Pfm2qOkDcgTt5ldMdJx9xOhTvUdCL1ly8M6gYLu+oxg/v73xm5kzGqjAI6Wy1Xf4kObk/tf/Xt6HSDxfL0ukIsJEOrsAeXH+goDUpIbb27N/8flQm7kBHhSvNxXXljVMBY9wSPEB/gVZiCieIdKPi4i91y+K6oQWeDOZZn286tWLi5tOjWmVOcGFjny/iRulR/G0LgR/jFGMRafr+9rtQTRa/BlQEEG7dSPP+BoXhpD8cyQxdipnW2arnr0dG0GWjKeAdGjDrrkM+ruRHyt3yZ+BwDD9LZX5MbAnEjTlEAakkoybATnIUpvLIn9Am7P3y49Jg+t/nvF7YOPOt5CJ2laVJ10rzR1TjashnWp+hhKf4axzLpN3gjxhzYFChHBxfmjoKvm+O9Ruiw5WeYCxvJv9RX9TsbASRTCsg== X-MS-Office365-Filtering-Correlation-Id: 207b5883-ce3f-43a3-77a1-08d39f390a11 X-Microsoft-Exchange-Diagnostics: 1; AM4PR0801MB1522; 2:il71qio58ySXz1LCMVVmwir6rOPfiC0f57rfFkXQi3cjdd22D1V3B6VRGu5EcX/2evCtohJYOy+KUMfgvolY/PkExRiLqmntdO0ad/C5lnBEYgi/KwWCBcgLca1n049bVIMAG3w4dxEG/Rbwl+9xgy1ifvTj+xljCoRbWABp1K26vr/pb2F6paFdJGSY1Ef0; 3:2Yu4ZcYy/MHeWPQdJbE2VH79dg22N7HWQ3SehofXEvnqeGh0EBx7Zyi3gT3tScxj2WYU7vfOxW2Pd5iBIgNoRCQGxzCE+oC5kZu6QjJ3ISXhCeF4eBBACn8uaUikGOf1w4MF8FEF9cCPIu1fLj4G2V049tcbui0AEa8UbJCxaKb4R2CGAuio/UhBZ8r5YRutsPnmmFrdzOsfVoW+Td/SGgqzS8pvNYJ5uj10FZbA57QY5ympA8kLCFQQVkvsbtnYPIfBCfdyj19oRUg+tpY6cQ== X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:AM4PR0801MB1522; X-Microsoft-Exchange-Diagnostics: 1; AM4PR0801MB1522; 25:vqLb0Zalv7L8UY03pe4lHB6ZJEfsHGB34fhkY+yp7Pc+BuiCweyp3GNtIvP/TKZnYAdsgi5xeoY7AI6JgAUEqDvbMG3JAoLBSxkmbmQ2+c2oonHpjAOkY67eldXCn79yi/fZPxo/GLyket3mLklu4P38pK6xLlcEBNrt9CkBV8rHfe7zc8bQeOzmJ42GkvAxgEzjDpxZ2TL1BEF5TDeObMXbUvUzQBoqClJ2ZTW9xbDs/+ogvsJBUlEH3viWBaf7P3wtMuDk9BGvjGC8x3i/bmjywGMSP3OXFPPTqOO2UvwkGAUSLX/lvx8L8NFj9N3Kff1Ehy0uqQz+gb3/je5BVKdG980hoR+v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BM9AdS5+77O33Ynffk5L/7J8yHVKaaEdW2xXTO29OjLMXh83R0hlxnv6uu6c4Yfk02j1X7IdeYUOBFiT8iapg9lbIUvD7/qVRPXqQvo6iNpj987L9sRxus/UMQU/A60B0gXXNdsfjZcfwx4TW3HWgHgEDRoSzP+0g11rTF8bmpVTWwqrdRB1evs4vlOgKsHNsFj0I3LBhkXLSwTk1zUbbv5J5lMo3YhFevWw10c9ufXJJa+wIqNMOaC/7LxlsZuoYJy3 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(9452136761055)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13024025)(8121501046)(5005006)(13020025)(13013025)(13023025)(3002001)(10201501046)(6055026); SRVR:AM4PR0801MB1522; BCL:0; PCL:0; RULEID:; SRVR:AM4PR0801MB1522; X-Forefront-PRVS: 0987ACA2E2 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM4PR0801MB1522; 23:rofZ2VnKGdev0NsY0A/AFxVO0hpOc/WnH5MfJK2?= =?us-ascii?Q?1REVXFglOHYmpGdKs+pZGTJT+KbbVg67bGovI03MybRN9UKkSWlFz32OIh2d?= =?us-ascii?Q?Z6a1rBVuKzTOgd2iBSohj+izcnYnLD2rpTKtqqTEm9lPACrBVRzGyB9KmYEG?= =?us-ascii?Q?QvMnt2fnPukXglC3UzAInLernmzdTC5A1p0LF4TKEB1WlyMqel85pffIpmBB?= =?us-ascii?Q?apTU8PCIDJQSjt94m1XdWjyRloTaED/jIUR988pAg8nhdNa15MxiW9emUKE3?= =?us-ascii?Q?SsJOscoJEA7fG62aSslwEg1nygi4vvS9s6DArdcVNbLBY5lLGcOGcykAt5XU?= =?us-ascii?Q?fWpD3vgFbqZsXGcNMakq5ZlCON7mFuO51vEm3p/sbOSEyjWTEwVX5Ox+5o2Y?= =?us-ascii?Q?/eq6I7C4yKtxrEtCiqT8/dmecZOOmyvuKVhWA9UN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ishpLZhksieZTzGVD6VEtaIiftsQCmp3Be6WFMcrMpjhnY/V9/rYk=; 5:GFvLB9nmAXb5GOorULEZS8W+nOKMhgzUicxWSzIozI03LrE1LM1Wr99oVE8VutE9v+vlOQClyskiZg+1nRCC/ZXzO0UKx/QoKgSoBIJsvsvnWix7m3fZgBmkDnTmfI0jsFNr5AJvxjmO3WG0YRlJcQ==; 24:ndZm1VKL849bXNLbzl6kYSaCPlNwF3926/0rQHmkzYBvEgHCjP74gl6T2u4/aHHcIBwdSd9ScBjaFFkj46Ov5BuPNk1COogxWWuQxE6Mo44=; 7:l2dd3TOtzaDKnS/V5As7/t22Tx6YiIRm/fJZK/V+4weRCjNpghGTrMqL1DWmtLg7lp5QQVqo60aKQCAVEQGlwrJUu49odPgRcC6kwVz6D+unY+Hm7+/ueiW7UMkEH7OXY8tJ6YXwRp0XZ3VDmneOkJxZXLdxVApWrVXStTc4ApOsx13xs0g3cO60fRD//6V4s9Wk2cuH3jjnsfWWTBZax+SCJiO0mmBnLWNKnd19rdZfy/eo5w3rg4TmET0eDYDLKq7gcP0oUPa9F/bTQ2in0A== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM4PR0801MB1522; 20:yZbpnpT9F36IqTSRYk7g7iBk8GcnTUp7nNfii88Xuq3d2bK1U6d3suiktfNoViwO9V7jtLhDmDGq57wcvgYOs/TSCoyMo1GAZnIUZPkMx9IOzrZ+avH0qps+L3SE6WyBMvfQoxE5ZzrmQzHm2e8zuE4IqKtRlWZtmm47DX3IyZo= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2016 09:46:11.7745 (UTC) X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[217.140.96.140]; Helo=[nebula.arm.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0801MB1522 X-MC-Unique: rRt1o28hNvOzbd_q3paSrA-1 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Current memblock debugfs output doesn't make the debug convenient enough, for example, lack of the 'flag' of the corresponding memblock region result in it's difficult to known whether the region has been mapped to the kernel linear map zone or not. This patch is trying to ease the dubug effort by adding 'size' and 'flag' output. The '/sys/kernel/debug/memblock/memory' output looks like before: 0: 0x0000008000000000..0x0000008001e7ffff 1: 0x0000008001e80000..0x00000083ff184fff 2: 0x00000083ff185000..0x00000083ff1c2fff 3: 0x00000083ff1c3000..0x00000083ff222fff 4: 0x00000083ff223000..0x00000083ffe42fff 5: 0x00000083ffe43000..0x00000083ffffffff After applied: 0: 0x0000008000000000..0x0000008001e7ffff 0x0000000001e80000 0x4 1: 0x0000008001e80000..0x00000083ff184fff 0x00000003fd305000 0x0 2: 0x00000083ff185000..0x00000083ff1c2fff 0x000000000003e000 0x4 3: 0x00000083ff1c3000..0x00000083ff222fff 0x0000000000060000 0x0 4: 0x00000083ff223000..0x00000083ffe42fff 0x0000000000c20000 0x4 5: 0x00000083ffe43000..0x00000083ffffffff 0x00000000001bd000 0x0 Signed-off-by: Dennis Chen Cc: Catalin Marinas Cc: Steve Capper Cc: Ard Biesheuvel Cc: Will Deacon Cc: Mark Rutland Cc: Rafael J. Wysocki Cc: Matt Fleming Cc: linux-mm@kvack.org Cc: linux-acpi@vger.kernel.org Cc: linux-efi@vger.kernel.org --- Change history: v3->v4: According to suggestion from Mark Rutland, make the memblock debugfs part as an individual patch since logically it's independent from others mm/memblock.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mm/memblock.c b/mm/memblock.c index ca09915..0fc0fa1 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -1677,13 +1677,15 @@ static int memblock_debug_show(struct seq_file *m, void *private) reg = &type->regions[i]; seq_printf(m, "%4d: ", i); if (sizeof(phys_addr_t) == 4) - seq_printf(m, "0x%08lx..0x%08lx\n", + seq_printf(m, "0x%08lx..0x%08lx 0x%08lx 0x%lx\n", (unsigned long)reg->base, - (unsigned long)(reg->base + reg->size - 1)); + (unsigned long)(reg->base + reg->size - 1), + (unsigned long)reg->size, reg->flags); else - seq_printf(m, "0x%016llx..0x%016llx\n", + seq_printf(m, "0x%016llx..0x%016llx 0x%016llx 0x%lx\n", (unsigned long long)reg->base, - (unsigned long long)(reg->base + reg->size - 1)); + (unsigned long long)(reg->base + reg->size - 1), + (unsigned long long)reg->size, reg->flags); } return 0;