From: Klara Modin <klarasmodin@gmail.com>
To: Oreoluwa Babatunde <quic_obabatun@quicinc.com>,
robh@kernel.org, saravanak@google.com, hch@lst.de,
m.szyprowski@samsung.com, robin.murphy@arm.com, will@kernel.org,
catalin.marinas@arm.com
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
iommu@lists.linux.dev, kernel@quicinc.com
Subject: Re: [PATCH v6 3/4] of: reserved_mem: Use unflatten_devicetree APIs to scan reserved memory nodes
Date: Fri, 5 Jul 2024 17:38:25 +0200 [thread overview]
Message-ID: <4905e651-4c37-4fb4-bbc1-af9633013134@gmail.com> (raw)
In-Reply-To: <986361f4-f000-4129-8214-39f2fb4a90da@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2433 bytes --]
On 2024-07-05 15:05, Klara Modin wrote:
> Hi,
>
> On 2024-05-29 00:36, Oreoluwa Babatunde wrote:
>> The unflatten_devicetree APIs have been setup and are available to be
>> used by the time the fdt_init_reserved_mem() function is called.
>> Since the unflatten_devicetree APIs are a more efficient way of scanning
>> through the DT nodes, switch to using these APIs to facilitate the rest
>> of the reserved memory processing.
>
> With this patch series, I've observed significantly less memory
> available to userspace on my Raspberry Pi 1 and 3.
>
> I see this message on the kernel console:
> Jul 4 23:13:49 bonnet kernel: OF: reserved mem: 0x1b000000..0x1effffff
> (65536 KiB) map non-reusable linux
>
> where it was previously marked as reusable:
> Jul 4 22:23:22 bonnet kernel: OF: reserved mem: 0x1b000000..0x1effffff
> (65536 KiB) map reusable linux,cma
>
> If I look at bcm283x.dtsi, it definitely has the reusable property.
>
> I've below pointed out the snippet I think could be suspicous.
>
>>
>> Signed-off-by: Oreoluwa Babatunde <quic_obabatun@quicinc.com>
>> ---
>> drivers/of/of_reserved_mem.c | 93 ++++++++++++++++++++-------------
>> include/linux/of_reserved_mem.h | 2 +-
>> kernel/dma/coherent.c | 10 ++--
>> kernel/dma/contiguous.c | 8 +--
>> kernel/dma/swiotlb.c | 10 ++--
>> 5 files changed, 72 insertions(+), 51 deletions(-)
>>
>> diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
>> index 113d593ea031..05283cd24c3b 100644
>> --- a/drivers/of/of_reserved_mem.c
>> +++ b/drivers/of/of_reserved_mem.c
>> @@ -447,7 +476,7 @@ static int __init
>> __reserved_mem_alloc_size(unsigned long node, const char *unam
>> uname, (unsigned long)(size / SZ_1M));
>> return -ENOMEM;
>> }
>
>
>> - fdt_reserved_mem_save_node(node, uname, base, size);
>> + fdt_reserved_mem_save_node(NULL, uname, base, size);
>
> This could perhaps be suspicious?
>
> The above message seems to come from of_init_reserved_mem_node when
> called from of_reserved_mem_save_node when called from here. This would
> mean that the node is not actually saved to rmem and thus not marked
> reusable?
>
>
>> return 0;
>> }
>
> Regards,
> Klara Modin
Attaching kernel logs of old and new behavior, and my config for reference.
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 27995 bytes --]
[-- Attachment #3: kern-new.log.gz --]
[-- Type: application/gzip, Size: 5155 bytes --]
[-- Attachment #4: kern-old.log.gz --]
[-- Type: application/gzip, Size: 4580 bytes --]
next prev parent reply other threads:[~2024-07-05 15:38 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-28 22:36 [PATCH v6 0/4] Dynamic Allocation of the reserved_mem array Oreoluwa Babatunde
2024-05-28 22:36 ` [PATCH v6 1/4] of: reserved_mem: Restruture how the reserved memory regions are processed Oreoluwa Babatunde
2024-06-10 21:34 ` Nathan Chancellor
2024-06-10 21:47 ` Mark Brown
2024-06-13 16:05 ` Oreoluwa Babatunde
2024-06-13 16:17 ` Conor Dooley
2024-06-13 16:38 ` Robin Murphy
2024-06-17 19:33 ` [PATCH] of: reserved_mem: Restructure code to call reserved mem init functions earlier Oreoluwa Babatunde
2024-06-18 8:53 ` kernel test robot
2024-06-20 0:10 ` [PATCH v2] " Oreoluwa Babatunde
2024-06-26 15:04 ` Nathan Chancellor
2024-06-26 15:16 ` Rob Herring
2024-06-26 15:48 ` Oreoluwa Babatunde
2024-06-25 21:25 ` [PATCH v6 1/4] of: reserved_mem: Restruture how the reserved memory regions are processed Mark Brown
2024-06-25 21:43 ` Oreoluwa Babatunde
2024-05-28 22:36 ` [PATCH v6 2/4] of: reserved_mem: Add code to dynamically allocate reserved_mem array Oreoluwa Babatunde
2024-05-28 22:36 ` [PATCH v6 3/4] of: reserved_mem: Use unflatten_devicetree APIs to scan reserved memory nodes Oreoluwa Babatunde
2024-07-05 13:05 ` Klara Modin
2024-07-05 15:38 ` Klara Modin [this message]
2024-07-08 23:12 ` Oreoluwa Babatunde
2024-07-08 23:45 ` Rob Herring
2024-05-28 22:36 ` [PATCH v6 4/4] of: reserved_mem: Rename fdt_* functions to refelct the change from using fdt APIs Oreoluwa Babatunde
2024-06-06 15:33 ` [PATCH v6 0/4] Dynamic Allocation of the reserved_mem array Rob Herring
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=4905e651-4c37-4fb4-bbc1-af9633013134@gmail.com \
--to=klarasmodin@gmail.com \
--cc=catalin.marinas@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=hch@lst.de \
--cc=iommu@lists.linux.dev \
--cc=kernel@quicinc.com \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=quic_obabatun@quicinc.com \
--cc=robh@kernel.org \
--cc=robin.murphy@arm.com \
--cc=saravanak@google.com \
--cc=will@kernel.org \
/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
all inboxes | Powered by JetHome®