From: Rob Herring <robh@kernel.org>
To: Martin Liu <liumartin@google.com>
Cc: frowand.list@gmail.com, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, surenb@google.com,
minchan@kernel.org, tkjos@google.com
Subject: Re: [PATCH] of: reserved-mem: expose reserved-mem details via debugfs
Date: Tue, 7 Feb 2023 15:04:58 -0600 [thread overview]
Message-ID: <20230207210458.GA4142905-robh@kernel.org> (raw)
In-Reply-To: <CAASV4h5ANYTJUN3gQxuLxeKMknyoyt7-YTxRRMcjrQXRrVRi5Q@mail.gmail.com>
On Wed, Feb 08, 2023 at 01:05:25AM +0800, Martin Liu wrote:
> On Mon, Feb 6, 2023 at 11:12 PM Rob Herring <robh+dt@kernel.org> wrote:
> >
> > On Mon, Feb 6, 2023 at 8:27 AM Martin Liu <liumartin@google.com> wrote:
> > >
> > > It's important to know reserved-mem information in mobile world
> > > since reserved memory via device tree keeps increased in platform
> > > (e.g., 45% in our platform). Therefore, it's crucial to know the
> > > reserved memory sizes breakdown for the memory accounting.
> > >
> > > This patch shows the reserved memory breakdown under debugfs to
> > > make them visible.
> > >
> > > Below is an example output:
> > > cat $debugfs/reserved_mem/show
> > > 0x00000009fc400000..0x00000009ffffffff ( 61440 KB ) map reusable test1
> > > 0x00000009f9000000..0x00000009fc3fffff ( 53248 KB ) map reusable test2
> > > 0x00000000ffdf0000..0x00000000ffffffff ( 2112 KB ) map non-reusable test3
> > > 0x00000009f6000000..0x00000009f8ffffff ( 49152 KB ) map reusable test4
> > > ...
> > > 0x00000000fd902000..0x00000000fd909fff ( 32 KB ) nomap non-reusable test38
> > > 0x00000000fd90a000..0x00000000fd90bfff ( 8 KB ) nomap non-reusable test39
> > > Total 39 regions, 1446140 KB
> >
> > This information is pretty much static, why not just print it during
> > boot? It's also just spitting out information that's straight from the
> > DT which is also available to userspace (flattened and unflattened).
>
> IIUC, for dynamic allocation cases, we can't get actual allocation layout
> from DT.
Right, so whomever does the allocation should print that out.
> Also, there could be some adjustment from memblock
> (ex. alignment). Therefore, printing it out from the reserved_mem would
> be more clear.
If memblock is adjusting, then shouldn't memblock print out the
addresses?
> However, as you mentioned, once the allocation is done, it should be pretty
> static. Thus, printing it during boot should be reasonable. If so, we
> could print
> them out in fdt_init_reserved_mem() like below. Is my understanding correct?
That looks mostly fine to me. If we can do it with the unflattened tree,
that would be better. I'm not sure off hand if that works here and you
are just incorrectly using of_get_flat_dt_prop() still, or if it is
indeed too early.
Rob
next prev parent reply other threads:[~2023-02-07 21:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-06 14:27 [PATCH] of: reserved-mem: expose reserved-mem details via debugfs Martin Liu
2023-02-06 15:12 ` Rob Herring
2023-02-07 17:05 ` Martin Liu
2023-02-07 21:04 ` Rob Herring [this message]
2023-02-08 8:59 ` Martin Liu
2023-02-06 17:24 ` kernel test robot
2023-02-06 19:57 ` kernel test robot
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=20230207210458.GA4142905-robh@kernel.org \
--to=robh@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=liumartin@google.com \
--cc=minchan@kernel.org \
--cc=surenb@google.com \
--cc=tkjos@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.