unity8-dash has a thread that is polling rather rapidly on epoll wait
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
unity-scopes-api (Ubuntu) |
Fix Released
|
Critical
|
Michi Henning | ||
Utopic |
Fix Released
|
Undecided
|
Unassigned | ||
unity-scopes-shell (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
unity8 (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
one of the threads to unity8-dash is creating quite a few wakeups per second:
# eventstat 60 1
Event/s PID Task Init Function Callback
13.02 2812 scopes_ng::Scop hrtimer_
process 2812 is a thread of unity8-dash
attaching strace to the thread we see:
root@ubuntu-
Process 2812 attached
clock_gettime(
epoll_wait(57, {}, 256, 115) = 0
clock_gettime(
socket(PF_LOCAL, SOCK_STREAM|
fcntl64(50, F_GETFL) = 0x2 (flags O_RDWR)
fcntl64(50, F_SETFL, O_RDWR|O_NONBLOCK) = 0
connect(50, {sa_family=
close(50) = 0
clock_gettime(
epoll_wait(57, {}, 256, 39) = 0
clock_gettime(
socket(PF_LOCAL, SOCK_STREAM|
fcntl64(50, F_GETFL) = 0x2 (flags O_RDWR)
fcntl64(50, F_SETFL, O_RDWR|O_NONBLOCK) = 0
connect(50, {sa_family=
close(50) = 0
clock_gettime(
epoll_wait(57, {}, 256, 65) = 0
clock_gettime(
socket(PF_LOCAL, SOCK_STREAM|
fcntl64(50, F_GETFL) = 0x2 (flags O_RDWR)
fcntl64(50, F_SETFL, O_RDWR|O_NONBLOCK) = 0
..ad infinitum...
the epoll_wait() is sleeping a very short while before a connect to a clickscope named socket path is attempted over and over again. Is this rapid polling really necessary? It's contributing to 0.50%-1.00% of the CPU load of the phone.
Related branches
- Marcus Tomlinson (community): Approve
- PS Jenkins bot (community): Approve (continuous-integration)
-
Diff: 406 lines (+219/-36)7 files modifiedCMakeLists.txt (+6/-1)
include/unity/scopes/internal/zmq_middleware/ConnectionPool.h (+24/-7)
src/scopes/internal/zmq_middleware/ConnectionPool.cpp (+45/-18)
src/scopes/internal/zmq_middleware/ZmqObject.cpp (+10/-10)
test/gtest/scopes/internal/zmq_middleware/CMakeLists.txt (+1/-0)
test/gtest/scopes/internal/zmq_middleware/ConnectionPool/CMakeLists.txt (+4/-0)
test/gtest/scopes/internal/zmq_middleware/ConnectionPool/ConnectionPool_test.cpp (+129/-0)
Changed in unity-scopes-api (Ubuntu): | |
assignee: | nobody → Michi Henning (michihenning) |
Changed in unity-scopes-shell (Ubuntu): | |
status: | New → Invalid |
Changed in unity-scopes-api (Ubuntu): | |
status: | New → In Progress |
Changed in unity8 (Ubuntu): | |
status: | Incomplete → Invalid |
Changed in unity-scopes-api (Ubuntu): | |
status: | In Progress → Fix Committed |
Changed in unity-scopes-api (Ubuntu): | |
importance: | Undecided → Critical |
tags: | added: rtm14 |
Changed in unity-scopes-api (Ubuntu): | |
status: | Fix Committed → Fix Released |
Changed in unity-scopes-api (Ubuntu Utopic): | |
status: | New → Fix Released |
scopes_ng:: is most probably unity-scopes-shell