ovs-vswitchd occasionally needs to do some activities that may block in the kernel unavoidably. This patch series changes ovs-vswitchd to do these activities in a separate "worker process".
This second version of the patch series applies feedback from Ethan and revises patch 11 and 12 into patches 11 through 14 because of changes on master in the meantime. Ben Pfaff (14): socket-util: Remove 'passcred' parameter from make_unix_socket(). socket-util: New function xset_nonblocking(). socket-util: Add functions for sending fds over Unix domain sockets. util: Introduce "subprogram_name" to identify subprocesses and threads. daemon: Factor out code into new function fork_and_wait_for_startup(). daemon: Factor out code into new function daemonize_post_detach(). vlog: Add VLOG_ABORT() to log and call abort(). worker: New library for breaking a daemon into multiple processes. vlog: Use system calls instead of stdio to write log files. vlog: Use worker process to write to log file. smap: New functions smap_from_json(), smap_to_json(). smap: New function smap_steal(). system-stats: Use "smap" instead of "shash". system-stats: Run as part of worker process. NEWS | 4 +- include/sparse/sys/socket.h | 31 +++ lib/automake.mk | 4 +- lib/daemon.c | 69 +++++-- lib/daemon.h | 3 + lib/fatal-signal.c | 4 +- lib/ovsdb-data.c | 19 +- lib/ovsdb-data.h | 5 +- lib/process.c | 6 +- lib/signals.c | 6 +- lib/smap.c | 48 +++++ lib/smap.h | 8 +- lib/socket-util.c | 278 +++++++++++++++++++++++++-- lib/socket-util.h | 30 +++- lib/stream-unix.c | 4 +- lib/util.c | 23 ++- lib/util.h | 3 + lib/vlog.c | 128 +++++++++++-- lib/vlog.h | 14 +- lib/worker.c | 447 +++++++++++++++++++++++++++++++++++++++++++ lib/worker.h | 68 +++++++ tests/test-unix-socket.c | 6 +- utilities/ovs-appctl.8.in | 10 + vswitchd/bridge.c | 59 ++++-- vswitchd/ovs-vswitchd.c | 5 + vswitchd/system-stats.c | 216 +++++++++++++++++---- vswitchd/system-stats.h | 8 +- 27 files changed, 1373 insertions(+), 133 deletions(-) create mode 100644 lib/worker.c create mode 100644 lib/worker.h -- 1.7.2.5 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev