monitor: Replace monitor_seq with periodic wakeup
authorJoe Stringer <joestringer@nicira.com>
Sat, 14 Dec 2013 01:24:10 +0000 (17:24 -0800)
committerEthan Jackson <ethan@nicira.com>
Sat, 14 Dec 2013 22:16:54 +0000 (14:16 -0800)
commit881d47a9fa901e71953a34367e9cd9b1f0571808
tree4cff01020bf5ed2dc5e0338af58628265d0343c7
parent14ee471cb95f2b2e97be9826643e83805a6102cb
monitor: Replace monitor_seq with periodic wakeup

Currently, every time a monitoring port is added or reconfigured, the
main thread notifies the monitoring thread to wake up immediately using
monitor_seq. When adding a large number of ports at once, this causes
contention as the threads fight over access to the monitor heap---one
thread adding new ports, the other popping and processing the new ports.

This patch removes this mechanism in favour of a simple periodic wakeup
in the monitor thread. When configuring batches of 500 tunnels at once,
up to a total of 5000 tunnels, this reduces configuration time by up to
35%. New port monitor port configuration may not take effect for as long
as ~100ms, although it may be less if the timer has not recently timed
out, or if a monitoring port is due to send a packet.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
ofproto/ofproto-dpif-monitor.c
tests/bfd.at
tests/cfm.at