diff options
author | Soheil Hassas Yeganeh <[email protected]> | 2020-12-18 14:02:06 -0800 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2020-12-19 11:18:38 -0800 |
commit | e59d3c64cba69b57263dff1d62838bc6a819ae37 (patch) | |
tree | 5a50023d770f5767d0dd82508d316de9182832ed /tools/perf/scripts/python/export-to-sqlite.py | |
parent | 00b27634bc471e0198f93d48694171121af2e159 (diff) |
epoll: eliminate unnecessary lock for zero timeout
We call ep_events_available() under lock when timeout is 0, and then call
it without locks in the loop for the other cases.
Instead, call ep_events_available() without lock for all cases. For
non-zero timeouts, we will recheck after adding the thread to the wait
queue. For zero timeout cases, by definition, user is opportunistically
polling and will have to call epoll_wait again in the future.
Note that this lock was kept in c5a282e9635e9 because the whole loop was
historically under lock.
This patch results in a 1% CPU/RPC reduction in RPC benchmarks.
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Soheil Hassas Yeganeh <[email protected]>
Suggested-by: Eric Dumazet <[email protected]>
Reviewed-by: Eric Dumazet <[email protected]>
Reviewed-by: Willem de Bruijn <[email protected]>
Reviewed-by: Khazhismel Kumykov <[email protected]>
Cc: Guantao Liu <[email protected]>
Cc: Linus Torvalds <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions