From: "Valdis Klētnieks" <valdis.kletnieks@vt.edu>
To: kjhg4321@naver.com
Cc: kernelnewbies@kernelnewbies.org
Subject: Re: Question about the "Dynamic reserved memory" patch
Date: Thu, 12 Mar 2020 23:54:41 -0400 [thread overview]
Message-ID: <374612.1584071681@turing-police> (raw)
In-Reply-To: <957b506c82ba1a9ea95b18fd34b2326e@cweb007.nm.nfra.io>
[-- Attachment #1.1: Type: text/plain, Size: 1772 bytes --]
On Fri, 13 Mar 2020 12:06:37 +0900, <kjhg4321@naver.com> said:
> In the __reserved_mem_reserve_reg() function, I found something that
> I couldn't easily understand.
>
> To get help, I sent an e-mail to this mailing list.
> if (first) {
> fdt_reserved_mem_save_node(node, uname, base, size);
> first = 0;
> }
> I found that fdt_reserved_mem_save_node() is called the regardless of
> memblock remove/reserve success.
>
> I think early_init_dt_reserve_memory_arch() can fail.(ex. for the lack
> of memblock's region)
>
> So I wonder there will be a situation where reserved_mem
> initialization will be executed without memory reservation.
What you probably missed is that function is wrapped in a #ifdef
CONFIG_OF_EARLY_FLATTREE - and is called to read in the OF devicetree data and
save it in a form the kernel can use.
So there usually shouldn't be a problem in reserving memory early in boot,
unless of course somebody bollixed up a devicetree entry and put in bad values
for base, size, and nomap. If that happens, the pr_info() call will fire and
hopefully notify somebody there's a problem.
However, fdt_reserved_mem_save_node() needs to happen anyhow, because that's
not initialiing the memory that wasn't actually reserved, it's recording the
fact that the devicetree had a reserved memory request in it, and that needs to
be remembered because there's a second pass over the devicetree data later on
(or so the comments in drivers/of/of_reserved_mem.c tell me).
Having said that, it *may* make sense to elevate the pr_info() call to a
pr_err(), to make it *obvious* that something went pear-shaped in the
devicetree. But that's a decision for the devicetree/OF maintainers.
[-- Attachment #1.2: Type: application/pgp-signature, Size: 832 bytes --]
[-- Attachment #2: Type: text/plain, Size: 170 bytes --]
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
next prev parent reply other threads:[~2020-03-13 3:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-13 3:06 Question about the "Dynamic reserved memory" patch 양원혁
2020-03-13 3:54 ` Valdis Klētnieks [this message]
2020-03-13 5:13 ` 양원혁
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=374612.1584071681@turing-police \
--to=valdis.kletnieks@vt.edu \
--cc=kernelnewbies@kernelnewbies.org \
--cc=kjhg4321@naver.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.