You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
sysupgrade OOM-killed on gk7205v500 NAND with the default 96M CMA MMZ (128 MB DDR) #2536
sysupgrade --archive=/root/fw.tgz -z (an 11 MB archive holding fitImage + rootfs.ubifs and their md5sums, kept on the overlay, with majestic stopped) is OOM-killed when it moves into RAM. Nothing is written, so the camera stays on the old image, but the update silently does not happen.
/root/su.log (stdout redirected there):
Moving the flash phase into RAM
Handing PID 1 over to the RAM root; ...
Killed
EXIT=137
dmesg:
(dump_header) from (oom_kill_process+0x59/0x2b0)
(oom_kill_process) from (out_of_memory+0x235/0x284)
Killed process 3065 (sysupgrade) total-vm:1444kB, anon-rss:264kB, file-rss:236kB, shmem-rss:0kB
Memory right after, with nothing running:
total used free shared buff/cache available
Mem: 123 8 97 0 18 96
MemAvailable: 98292 kB
CmaTotal: 98304 kB
CmaFree: 98124 kB
free reports 97 MB free, but 96 MB of it is the MMZ CMA area. The RAM root that sysupgrade pivots into, and the images unpacked into it, cannot be placed in CMA pages, which leaves about 27 MB of ordinary memory for the whole flash phase. An earlier flash on the same camera with the same layout succeeded, so this is a thin margin that sometimes fails, not a guaranteed failure.
Workaround that worked: boot once with mmz=anonymous,0,0x42000000,32M, run the same sysupgrade (it completed), then put the 96M bootargs back.
The same layout also makes the obvious alternative worse. Copying the full 22 MB openipc.gk7205v500-nand-ultimate.tgz into /tmp first OOM-killed most processes on the camera.
What you expected instead
Either sysupgrade fits in the memory left outside CMA on a 128 MB gk7205v500, or it refuses up front with a clear message before handing PID 1 over. For example, it could check MemAvailable - CmaFree against what the RAM phase needs.
A related question is whether 96 MB of CMA is the right default for 128 MB parts. The streaming pipeline on this camera (1080p H.265 main stream + JPEG) allocated about 15 MB of MMZ.
Activity