[ovs-git] Open vSwitch: Use "error-checking" mutexes in place of other kinds wherever possible. (master)

dev at openvswitch.org dev at openvswitch.org
Tue Aug 20 20:40: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  834d6cafe4797861b7547966b4dcc95b374331be (commit)
      from  0891637f67671c0654b9ff6b4c25a654375d24e2 (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 834d6cafe4797861b7547966b4dcc95b374331be
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=834d6cafe4797861b7547966b4dcc95b374331be
Author: Ben Pfaff <blp at nicira.com>
		
Use "error-checking" mutexes in place of other kinds wherever possible.
		
We've seen a number of deadlocks in the tree since thread safety was
introduced.  So far, all of these are self-deadlocks, that is, a single
thread acquiring a lock and then attempting to re-acquire the same lock
recursively.  When this has happened, the process simply hung, and it was
somewhat difficult to find the cause.

POSIX "error-checking" mutexes check for this specific problem (and
others).  This commit switches from other types of mutexes to
error-checking mutexes everywhere that we can, that is, everywhere that
we're not using recursive mutexes.  This ought to help find problems more
quickly in the future.

There might be performance advantages to other kinds of mutexes in some
cases.  However, the existing mutex type choices were just guesses, so I'd
rather go for easy detection of errors until we know that other mutex
types actually perform better in specific cases.  Also, I did a quick
microbenchmark of glibc mutex types on my host and found that the
error checking mutexes weren't any slower than the other types, at least
when the mutex is uncontended.

Signed-off-by: Ben Pfaff <blp at nicira.com>
Acked-by: Ethan Jackson <ethan at nicira.com>


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

Summary of changes:
 include/sparse/pthread.h      |    3 ---
 lib/dpif-linux.c              |    2 +-
 lib/fatal-signal.c            |    2 +-
 lib/lacp.c                    |    4 ++--
 lib/netdev-bsd.c              |    6 +++---
 lib/netdev-dummy.c            |    2 +-
 lib/netdev-linux.c            |    2 +-
 lib/netdev-vport.c            |    2 +-
 lib/netlink-socket.c          |    2 +-
 lib/ovs-atomic-gcc4+.c        |    2 +-
 lib/ovs-thread.c              |   18 ++++++++++++++++--
 lib/ovs-thread.h              |   38 ++++++--------------------------------
 lib/seq.c                     |    2 +-
 lib/stp.c                     |    4 ++--
 lib/uuid.c                    |    2 +-
 lib/vlog.c                    |    2 +-
 lib/vlog.h                    |    2 +-
 ofproto/ofproto-dpif-sflow.c  |    2 +-
 ofproto/ofproto-dpif-upcall.c |    8 ++++----
 ofproto/ofproto-dpif.c        |    8 ++++----
 ofproto/ofproto.c             |    4 ++--
 vswitchd/system-stats.c       |    2 +-
 22 files changed, 52 insertions(+), 67 deletions(-)


hooks/post-receive
-- 
Open vSwitch



More information about the git mailing list