]> code.ossystems Code Review - openembedded-core.git/commit
unfs3: fixed the issue that unfsd consumes 100% CPU
authorHaiqing Bai <Haiqing.Bai@windriver.com>
Thu, 24 Oct 2019 02:33:04 +0000 (10:33 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 24 Oct 2019 11:03:38 +0000 (12:03 +0100)
commit1f6784d2e839f81749d21ad1b615a9f7bb0e64d6
tree8e336a35bf9a8176162ba833b7e0f978facc7ef3
parent3c39d4158677b97253df63f23b74c3a9dd5539f6
unfs3: fixed the issue that unfsd consumes 100% CPU

The 'accept' function on the socket of unfsd daemon
is always in below error state:
accept(4, 0x7ffd5e6dddc0, [128]) = -1 EINVAL (Invalid argument)
accept(6, 0x7ffd5e6dddc0, [128]) = -1 EINVAL (Invalid argument)

And 'strace -c -p <the pid of unfsd>' shows:
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 70.87    0.005392           0    513886    513886 accept
 29.13    0.002216           0    256943           poll

This error state is in the 'for' loop of the daemon, so it consumes 100%
CPU. The reason is that 'listen' is not called for the TCP socket before
'accept'. Actually the called 'svc_tli_create' from libtirpc will not call
'listen' on a bound socket.

Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/unfs3/unfs3/0001-Add-listen-action-for-a-tcp-socket.patch [new file with mode: 0644]
meta/recipes-devtools/unfs3/unfs3_git.bb