[ovs-git] Open vSwitch: async-append: Refactor to avoid requiring enabling while single threaded. (master)

dev at openvswitch.org dev at openvswitch.org
Sat Aug 3 03:04:09 UTC 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Open vSwitch".

The branch, master has been updated
       via  888e0cf441e1cd7dc2846a91f85319abd7419246 (commit)
      from  3d9c5e58759d8da79b1d6c670f77e95ee2ad92f7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 888e0cf441e1cd7dc2846a91f85319abd7419246
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=888e0cf441e1cd7dc2846a91f85319abd7419246
Author: Ben Pfaff <blp at nicira.com>
		
async-append: Refactor to avoid requiring enabling while single threaded.
		
Until now, the async append interface has required async_append_enable()
to be called while the process was still single-threaded, with the
rationale being that async_append_enable() could race with
async_append_write() on some existing async_append object.  This was a
difficult problem when the async append interface was introduced, because
at the time Open vSwitch did not have any infrastructure for inter-thread
synchronization.

Now it is easy to solve, by introducing synchronization into the
async append module.  However, that's more or less wasted, because the
client is already required to serialize access to async append objects.
Moreover, vlog, the only existing client, needs to serialize access for
other reasons, so it wouldn't even be possible to just drop the client's
synchronization.

This commit therefore takes another approach.  It drops the
async_append_enable() interface entirely.  Now any existing async_append
object is always enabled.  The responsibility for "enabling", then, now
rests in whether the client creates and uses an async_append object, and
so vlog now takes care of that by itself.  Also, since vlog now has to
deal with sometimes having an async_append and sometimes not having one,
we might as well allow creating an async_append to fail, thereby slightly
simplifying the "no async I/O" implementation from "write synchronously"
to "always fail creating an async_append".

Reported-by: Shih-Hao Li <shihli at nicira.com>
Signed-off-by: Ben Pfaff <blp at nicira.com>


-----------------------------------------------------------------------

Summary of changes:
 lib/async-append-aio.c                           |   15 -----------
 lib/{async-append-sync.c => async-append-null.c} |   29 +++++++-------------
 lib/async-append.h                               |   20 +++-----------
 lib/automake.mk                                  |    2 +-
 lib/vlog.c                                       |   31 +++++++++++++++++++---
 lib/vlog.h                                       |    1 +
 vswitchd/bridge.c                                |    2 +-
 7 files changed, 42 insertions(+), 58 deletions(-)
 rename lib/{async-append-sync.c => async-append-null.c} (63%)


hooks/post-receive
-- 
Open vSwitch



More information about the git mailing list