Need suggestions to debug 100% cpu usage issue on my developing device

HI all,

My developing device only have 128M Ram and 128M NAND, which is mips cpu with uClibc library.

  1. If I try to use failsafe mode to check system status, looks like 100% cpu usage problem is gone.

  2. If I try to use normal mode to check system status(switch_root), looks like doing anything would cause 100% cpu usage. For example, if I try to connect webUI from nginx. Check top, kworker and nginx will occupy a lot of cpu resource.

Mem: 21264K used, 88532K free, 132K shrd, 1196K buff, 2220K cached
CPU:   2% usr  97% sys   0% nic   0% idle   0% io   0% irq   0% sirq
Load average: 3.49 1.03 0.36 2/66 999
  746     1 root     S    10216   9%  19% nginx: master process /usr/sbin/nginx 
    4     2 root     SW       0   0%  19% [kworker/0:0]
  1. From top, we know we have about 88M free memory, but if I copy about 50MB into tmp(we don't limit the size of tmp), the kernel will show up OOM-Kill.
root@OpenWrt:/# mount
/dev/root on /rom type squashfs (ro,relatime)
devtmpfs on /rom/dev type devtmpfs (rw,relatime,size=21516k,nr_inodes=5379,mode=755)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
/dev/ubi0_0 on /overlay type ubifs (rw,noatime)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)
/dev/mtdblock5 on /etc/factory type ext4 (ro,noatime,data=ordered)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000)

Looks like tmpfs and switch_root are clues to debug, but
does anyone have experiences similar my situation?
Please help. Thanks a lot.

Finally, I resolve the problem. Since my developing device only have 128MB Ram, and OpenWrt will set up about 16MB to vm.min_free_kbytes. This setting will cause CPU always doing load/free data from NAND into Ram. So, I change this value as same as original SDK, this issue is done. Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.