linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@kernel.org>
To: Jaewon Kim <jaewon31.kim@samsung.com>
Cc: "vbabka@suse.cz" <vbabka@suse.cz>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"jaewon31.kim@gmail.com" <jaewon31.kim@gmail.com>,
	"tkjos@google.com" <tkjos@google.com>,
	Wei Yang <richard.weiyang@gmail.com>,
	Pintu Agarwal <pintu.ping@gmail.com>
Subject: Re: (2) [RESEND PATCH 00/10] memblock: introduce memsize showing reserved memory
Date: Mon, 27 May 2024 19:22:36 +0300	[thread overview]
Message-ID: <ZlSzTOSu06ziefUj@kernel.org> (raw)
In-Reply-To: <20240527013504epcms1p22bec7b83f2a42e76877b97ed0d769009@epcms1p2>

On Mon, May 27, 2024 at 10:35:04AM +0900, Jaewon Kim wrote:
> >On Fri, May 24, 2024 at 06:07:15PM +0900, Jaewon Kim wrote:
> >> >On Tue, May 21, 2024 at 07:17:53PM +0900, Jaewon Kim wrote:
> >> >> >On Tue, May 21, 2024 at 11:53:29AM +0900, Jaewon Kim wrote:
> >> >> >> 
> >> >> >> This is actually RESEND as it was introduced 2 years ago.
> >> >> >> Please refer to https://lore.kernel.org/linux-mm/YkQB6Ah603yPR3qf@kernel.org/#t
> >> >> >> 
> >> >> >> > But you never provided details about *why* you want this information exposed.
> >> >> >> 
> >> >> >> For your question, I'd like to say ;
> >> >> >> We can see the same format and exact information between different version of kernel status.
> >> >> >> 
> >> >> >> 1) Internally we can check if the reserved memory changes.
> >> >> >> 2) Externally we can communicate between chipset vendors and OEM, with a same format.
> >> >> >
> >> >> >Why the existing debugfs interface is not sufficient?
> >> >> 
> >> >> debugfs/memblock/memory & debugfs/memblock/reserved have changed its
> >> >> format but still does not show name, reusable, kernel size.  If memory is
> >> >> reserved from memblock, and did not freed back to memblock. Memblock does
> >> >> not know even after the memory is freed to system.  I think a simple
> >> >> debug interface is needed to easily communicate with others or compare
> >> >> different SW releases.
> >> >
> >> >I still don't understand what problem are you trying to solve with these
> >> >patches. 
> >> 
> >> I think we need a common API to easily see the reserved memory status.
> >> Through MemTotal on /proc/meminfo, we can only see only the total size
> >> of reserved memory. We don't how big kernel init size within the the
> >> total size. I think this really helps to compare different kernel and
> >> communicate with others.
> >
> > As was already mentioned on this thread, something like
> >
> > $ dmesg | grep Memory:
> > [    0.000000] Memory: 8058204K/8388608K available (35392K kernel code, 8706K rwdata, 23320K rodata, 16832K init, 848K bss, 297636K reserved, 32768K cma-reserved)
> >
> > already shows init, rodata and bss sizes.
> >
> > And size -A vmlinux provides detailed breakdown of the kernel image into
> > sections.
> > 
> >> I think the debugfs API or early boot log shows quite much information
> >> for the reserved memory information defined in device tree. But it is
> >> difficult to see after boot, as the boot log already was removed ouf of
> >> the kernel log buffer.
> >
> > Kernel log is persisted, isn't it?
> 
> Early kernel log is removed after other log is written to the log buffer. I may
> not be able to get it, after waiting for the target device is ready to be
> connected from host PC. I wanted to keep that information.
> 
> Actually the commit aeb9267eb6b1 ("of: reserved-mem: print out reserved-mem
> details during boot") seems to show most of information if I can get the early
> boot log.

Unless the kernel log is stored on the target you need to redirect
target's console to a file on the host, then all of the boot log will be
accessible on the host.

Then with memblock=debug kernel parameter you'll be able to get much more
information about memblock reservations.
 
> If you don't mind, let me ask one question. How can we easily find the undefined
> DRAM memory regions in kernel persective. Do we have to look into the debugfs 
> memblock/memory and combine the information with the kernel log information?
> 
> case1) Actual DRAM is mapped as two regions like,
>    2GB @ 0x00000000_80000000 and 6GB @ 0x00000008_80000000,
>    how can we find the hole, 0x00000000_80000000--0x00000008_7FFFFFFF ?

The actual memory banks reported to Linux are shown at
debugfs/memblock/memory
 
> case2) If some region is already carved out at bootloader stage like.
>    0x00000000_81200000-0x00000000_812FFFFF was not initinally on memblock.
>    0x00000000_80000000-0x00000000_81200000 was removed as no-map through device tree.
>    how can we find the hole, 0x00000000_81200000-0x00000000_812FFFFF ?

nomap regions are shown in debugfs/memblock/memory as NOMAP.

-- 
Sincerely yours,
Mike.


  reply	other threads:[~2024-05-27 16:24 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20240521024009epcas1p10ed9f9b929203183a29f79508e79bb76@epcas1p1.samsung.com>
2024-05-21  2:39 ` Jaewon Kim
     [not found]   ` <CGME20240521024009epcas1p4451928c8f5b32bf84082a24c59ca7dd0@epcas1p4.samsung.com>
2024-05-21  2:39     ` [RESEND PATCH 01/10] " Jaewon Kim
     [not found]   ` <CGME20240521024009epcas1p3e80e90863a453053d5aac901ef644070@epcas1p3.samsung.com>
2024-05-21  2:39     ` [RESEND PATCH 02/10] memblock: detect hidden memory hole size Jaewon Kim
     [not found]   ` <CGME20240521024009epcas1p152671a613e86fa83d840962ee3db50fb@epcas1p1.samsung.com>
2024-05-21  2:39     ` [RESEND PATCH 03/10] memblock: handle overlapped reserved memory region Jaewon Kim
     [not found]   ` <CGME20240521024009epcas1p3440f857e3b31b319c270e2d658379383@epcas1p3.samsung.com>
2024-05-21  2:39     ` [RESEND PATCH 04/10] memblock: take a region intersecting an unknown region Jaewon Kim
     [not found]   ` <CGME20240521024009epcas1p20ddcabed3d037904a9c651d27f82c077@epcas1p2.samsung.com>
2024-05-21  2:39     ` [RESEND PATCH 05/10] memblock: track memblock changed at early param Jaewon Kim
     [not found]   ` <CGME20240521024009epcas1p40d0ea59e8ae93f6cc89846626fea4207@epcas1p4.samsung.com>
2024-05-21  2:39     ` [RESEND PATCH 06/10] memblock: recognize late freed size by checking PageReserved Jaewon Kim
     [not found]   ` <CGME20240521024009epcas1p3ccda7b2d9e6518b4575427c957e19377@epcas1p3.samsung.com>
2024-05-21  2:39     ` [RESEND PATCH 07/10] memblock: track kernel size on memsize Jaewon Kim
2024-05-22 19:03       ` kernel test robot
     [not found]   ` <CGME20240521024009epcas1p291bbc11c4e5cdaa922ca302d95330e6b@epcas1p2.samsung.com>
2024-05-21  2:39     ` [RESEND PATCH 08/10] memblock: print memsize summary information Jaewon Kim
     [not found]   ` <CGME20240521024009epcas1p441a4c458d251eec7bb6e63e671c25b4e@epcas1p4.samsung.com>
2024-05-21  2:39     ` [RESEND PATCH 09/10] memblock: print kernel internal size Jaewon Kim
2024-05-22 18:52       ` kernel test robot
     [not found]   ` <CGME20240521024009epcas1p15a3290b675ee66339033c185a5a8c00b@epcas1p1.samsung.com>
2024-05-21  2:39     ` [RESEND PATCH 10/10] memblock: support memsize reusable to consider as reusable Jaewon Kim
2024-05-22 22:40       ` kernel test robot
     [not found]       ` <CGME20240522224129epcas1p10433785cc14bef5de93e9f26aa599ff0@epcms1p8>
2024-05-23 10:55         ` Jaewon Kim
     [not found]   ` <CGME20240521024009epcas1p10ed9f9b929203183a29f79508e79bb76@epcms1p6>
2024-05-21  2:53     ` [RESEND PATCH 00/10] memblock: introduce memsize showing reserved memory Jaewon Kim
2024-05-21  7:31       ` Mike Rapoport
     [not found]       ` <CGME20240521024009epcas1p10ed9f9b929203183a29f79508e79bb76@epcms1p5>
2024-05-21 10:17         ` Jaewon Kim
2024-05-22  8:16           ` (2) " Wei Yang
2024-05-23 14:34           ` Mike Rapoport
2024-05-24 17:33             ` Pintu Agarwal
     [not found]           ` <CGME20240521024009epcas1p10ed9f9b929203183a29f79508e79bb76@epcms1p8>
2024-05-22  8:47             ` Jaewon Kim
2024-05-23  8:55               ` Wei Yang
     [not found]               ` <CGME20240521024009epcas1p10ed9f9b929203183a29f79508e79bb76@epcms1p2>
2024-05-23  9:23                 ` 김재원
2024-05-24  9:07                 ` (2) " Jaewon Kim
2024-05-26 13:55                   ` Mike Rapoport
     [not found]                   ` <CGME20240521024009epcas1p10ed9f9b929203183a29f79508e79bb76@epcms1p7>
2024-05-27  1:30                     ` Jaewon Kim
     [not found]                     ` <20240529095119epcms1p73f0e9ff756bcb2ee6a14db459128a644@epcms1p7>
2024-05-29 11:35                       ` Wei Yang
2024-05-29 13:10                         ` Jaewon Kim
2024-05-30  0:03                           ` Wei Yang
2024-05-27  1:35                 ` Jaewon Kim
2024-05-27 16:22                   ` Mike Rapoport [this message]
2024-05-30 10:49             ` Jaewon Kim
2024-05-31  1:05               ` (2) " Wei Yang
     [not found]               ` <CGME20240521024009epcas1p10ed9f9b929203183a29f79508e79bb76@epcms1p4>
2024-05-31  8:21                 ` Jaewon Kim
2024-06-01  1:40                   ` Wei Yang
2024-06-03  9:33             ` Jaewon Kim
2024-05-22  8:20       ` Wei Yang

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=ZlSzTOSu06ziefUj@kernel.org \
    --to=rppt@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=jaewon31.kim@gmail.com \
    --cc=jaewon31.kim@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pintu.ping@gmail.com \
    --cc=richard.weiyang@gmail.com \
    --cc=tkjos@google.com \
    --cc=vbabka@suse.cz \
    /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