linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jaewon Kim <jaewon31.kim@samsung.com>
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 <jaewon31.kim@samsung.com>
Subject: [PATCH 0/8] memblock: introduce memsize showing reserved memory
Date: Thu, 24 Mar 2022 16:01:50 +0900	[thread overview]
Message-ID: <20220324070158.22969-1-jaewon31.kim@samsung.com> (raw)
In-Reply-To: CGME20220324065919epcas1p4c79da5f6ec4fa0311409ca24a38785d8@epcas1p4.samsung.com

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


       reply	other threads:[~2022-03-24  6:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20220324065919epcas1p4c79da5f6ec4fa0311409ca24a38785d8@epcas1p4.samsung.com>
2022-03-24  7:01 ` Jaewon Kim [this message]
     [not found]   ` <CGME20220324065919epcas1p35bafcd9151cf0469e4e933250c491a88@epcas1p3.samsung.com>
2022-03-24  7:01     ` [PATCH 1/8] memblock: introduce memsize showing reserved memory Jaewon Kim
     [not found]   ` <CGME20220324065919epcas1p1b30eabc8bbe01da1ef90280b6ee8bcea@epcas1p1.samsung.com>
2022-03-24  7:01     ` [PATCH 2/8] memblock: detect hidden memory hole size Jaewon Kim
     [not found]   ` <CGME20220324065919epcas1p3429ec2c9595c54ffe4ee25f273febd1c@epcas1p3.samsung.com>
2022-03-24  7:01     ` [PATCH 3/8] memblock: handle overlapped reserved memory region Jaewon Kim
     [not found]   ` <CGME20220324065919epcas1p256ff799f37a765a432475808e708d639@epcas1p2.samsung.com>
2022-03-24  7:01     ` [PATCH 4/8] memblock: track memblock changed at early param Jaewon Kim
     [not found]   ` <CGME20220324065919epcas1p3a3a267c4348be4fd3bb8437d4e6db142@epcas1p3.samsung.com>
2022-03-24  7:01     ` [PATCH 5/8] memblock: track kernel size on memsize Jaewon Kim
     [not found]   ` <CGME20220324065919epcas1p1058e2841b009d8c7d683bc0408f8a5a4@epcas1p1.samsung.com>
2022-03-24  7:01     ` [PATCH 6/8] memblock: recognize late free by checking PageReserved Jaewon Kim
     [not found]   ` <CGME20220324065919epcas1p4b935c884aa3fde0917f6dff8bff128ed@epcas1p4.samsung.com>
2022-03-24  7:01     ` [PATCH 7/8] memblock: print memsize summary information Jaewon Kim
     [not found]   ` <CGME20220324065919epcas1p46b5381b1b839d7076673c23e8f9b0bba@epcas1p4.samsung.com>
2022-03-24  7:01     ` [PATCH 8/8] memblock: print kernel internal size Jaewon Kim
2022-03-25  7:46   ` [PATCH 0/8] memblock: introduce memsize showing reserved memory Mike Rapoport
     [not found]   ` <CGME20220324065919epcas1p4c79da5f6ec4fa0311409ca24a38785d8@epcms1p3>
2022-03-25  8:38     ` Jaewon Kim
2022-03-27  7:40       ` Mike Rapoport
     [not found]       ` <CGME20220324065919epcas1p4c79da5f6ec4fa0311409ca24a38785d8@epcms1p1>
2022-03-27 13:53         ` Jaewon Kim
2022-03-27 15:15           ` Mike Rapoport
     [not found]           ` <CGME20220324065919epcas1p4c79da5f6ec4fa0311409ca24a38785d8@epcms1p7>
2022-03-29  2:46             ` Jaewon Kim
2022-03-30  7:08               ` Mike Rapoport
     [not found]               ` <CGME20220324065919epcas1p4c79da5f6ec4fa0311409ca24a38785d8@epcms1p8>
2022-03-30  7:22                 ` Jaewon Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220324070158.22969-1-jaewon31.kim@samsung.com \
    --to=jaewon31.kim@samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=jaewon31.kim@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rppt@kernel.org \
    --cc=vbabka@suse.cz \
    --cc=ytk.lee@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).