Meng Hu
unread,Jan 6, 2010, 10:44:32 AM1/6/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to android-...@googlegroups.com
Hi
I ran into a scenario where init process consumes lot of cpu. The strace on init shows the following repeating
poll([{fd=4, events=POLLIN, revents=POLLIN|POLLERR}, {fd=6, events=POLLIN}, {fd=9, events=POLLIN}], 3, -1) = 1
Line 1013-1027 in system/core/init.c only match the exact revents so if revents of any fd is POLLIN|POLLERR, like above, it never tries to read from the fd. Then the next poll returns immediately which causes a spin in this loop.
While there might be another problem that causes the POLLERR on my uevent socket, I am thinking that init ought to be able to recover from these errors, instead of spinning. For example, init could read
the socket whenever the POLLIN bit is set and logs errors from recv(). The sockets can be restarted at some point too.
Any comments?
Regards,
Meng