Closed Susurrus closed 5 months ago
It really helps to get downstream dmesg, you can also get it from e.g. TWRP, there should be quite a bit less spam. Otherwise running this on your host should get dmesg as early as possible which normally contains the beginning of the kernel logs also: adb wait-for-device && adb shell su root dmesg
. In that dmesg you should find the exact addresses that downstream uses, which is quite a bit more helpful than trying to read the downstream dtb.
I didn't read through everything in detail but in general you should also include mba_region and friends upstream, as they will be used in the future and you also never know what kind of special restrictions this area of memory might have (normally it shouldn't because the firmware is mostly relocatable but who knows)
Thanks, really helpful knowing about adb wait-for-device
. I tried that and am only getting dmesg logs starting at 11.2s, way after all of the memory reserve part of the logs. The best I've gotten so far is to extract logs from the bootloader. They don't have anything from what I can see, but they do verify the info above that I've extracted from the DTB:
I also saw this commit, so I'm thinking I need to get better names for the two reserved
sections. Is that right?
I've been thinking about this more as I don't really know what to do to resolve this It seems reasonable to use the values I have from the downstream DTS, so for the clear values I have listed there I don't know what more I'll learn from the dmesg logs. But I'm not an expert here, am I missing something?
I think there are two ways to get more info from a downstream kernel:
1 seems pretty complicated, not certain how to do that with pmOS or LineageOS. Will take a while to figure out. 2 seems like the better option, tho it won't tell me names of things.
Anyone have any advice?
You can also check cat /proc/iomem
on downstream , that should at least give you the ranges where memory is mapped, not sure if it gives you names also. Make sure to run as root, otherwise some info is missing.
But if it's completely unclear what a given reserved-memory section does, call it unknown or reserved or something I guess. Just don't call the nodes memory
Just ran stress-ng --vm 1 --vm-bytes 97% --vm-method all --verify -t 10 -v
, which was recommended in a separate discussion about reserved memory and it didn't crash.
@z3ntu Thanks, that gave me something more to go on as I could get it from TWRP (see below). I'll see if I can get it off downstream as I think it'll be much more revealing.
# cat /proc/iomem
00000000-083fffff : System RAM
00008000-009257fb : Kernel code
00b0c000-0100eb63 : Kernel data
0a400000-0cafffff : System RAM
0f600000-0f9fffff : System RAM
0ff00000-5f2fffff : System RAM
f9017000-f9017fff : msm-watchdog
f9824900-f9824a1b : mmc0
f98a4900-f98a4a1b : mmc1
f9923000-f9923fff : f9923000.i2c
f9924000-f9924fff : f9924000.i2c
f9925000-f9925fff : f9925000.i2c
f9926000-f9926fff : f9926000.i2c
f9927000-f9927fff : f9927000.i2c
f9928000-f9928fff : f9928000.i2c
f9a55000-f9a553ff : /soc/usb@f9a55000
f9a55000-f9a553ff : /soc/usb@f9a55000
fc380000-fc3e9fff : fc380000.msm-bimc
fc4281d0-fc4291cf : vmpm
fc460000-fc463fff : fc460000.msm-sys-noc
fc468000-fc46bfff : fc468000.msm-periph-noc
fc478000-fc47bfff : fc478000.msm-mmss-noc
fc480000-fc483fff : fc480000.msm-config-noc
fc4a8000-fc4a9fff : tsens_physical
fc4bc000-fc4bcfff : tsens_eeprom_physical
fdb00000-fdb0ffff : kgsl-3d0
fdb20000-fdb2ffff : kgsl-3d0
fdc80000-fdc803ff : vbif_base
fdce0000-fdce3fff : wrapper_base
fec00000-fec1ffff : fdd00000.qcom,ocmem
Discussed this off-bug, since the stress testing went fine, these values should be good enough to get things upstreamed. THey can be revised as needed later on.
I'm working on upstreaming my code changes, and there are some patches pending to upstream much beyond the initial boot. The memory sections that I copied from
matisse-wifi
were:However, upstream doesn't have
mba_region
,mpss_region
, orwcnss_region
defined. So I'm trying to figure out how to approach this. I have a few options:I would think Option 1 makes the most sense, what do folks think?
However, this got my reviewing the memory locations as I blindly copy/pasted them from
matisse-wifi
. I tried to getdmesg
logs from a rooted LineageOS build, but there's so much noise in the kernel buffer, I didn't get the early stuff. I don't want to try to recompile a few kernel with a larger buffer. However, I think the DTS has most of what I need.Here's a comparison of the reserved memory values I had above and relevant items I found in the downstream downstream DTS:
I'm thinking it should be slightly larger at 0xfa0000 in size based on:
From downstream DTS, there's the
qcom,msm-mem-hole
, which lists this same address, but 0x2000000 in size (so slightly larger):I see no reference to this anywhere in the downstream DTS, so I don't know where this comes from...
This memory address was also in the
qcom,msm-mem-hole
node shown above, but much larger at 0x2b00000.Couldn't find anything with this memory address. However, given the naming, I'm confused what this is versus
qcom,wcnss-wlan@fb000000
in downstream.I think this should have a size of
0x1d00000
based on:Various addresses in the downstream DTS, but nothing that has this one or looks otherwise obviously applicable.
This memory address was also in the
qcom,msm-mem-hole
node shown above, but much larger at 0x500000.Not certain what this is for. It's suspiciously close to
qcom,wcnss-wlan@fb000000
(just off by a 0) in the downstream kernel, but that refers to wcnss, which has a separate memory reserved location above:Looks correct based on the following:
Looks correct based on the following:
Now there's some other items of note:
A
memory
node that seems related toion-heap
:I don't know what this Ion thing is, but this slidedeck references it. But it's really this post that clarifies that it's an Android-specific shared memory system. Since it's Android specific, I think I can ignore it.