2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-30 05:47:55 +00:00

6 Commits

Author SHA1 Message Date
Thomas Graf
ca6ba70092 list: Rename struct list to struct ovs_list
struct list is a common name and can't be used in public headers.

Signed-off-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Ben Pfaff <blp@nicira.com>
2014-12-15 14:15:12 +01:00
Ben Pfaff
2113847254 seq: Attribute wakeups to seq_wait()'s caller, not to seq_wait() itself.
The poll_loop code has a feature that, when turned on manually or
automatically (due to high CPU use), logs the source file and line number
of the code that caused a thread to wake up from poll().  Until now, when
a function calls seq_wait(), the source file and line number logged was
the code inside seq_wait().  seq_wait() has many callers, so that
information is not as useful as it could be.  This commit changes the
source file and line number used to be that of seq_wait()'s caller.

I found this useful for debugging.

Signed-off-by: Ben Pfaff <blp@nicira.com>
2014-05-22 09:39:49 -07:00
Ben Pfaff
834d6cafe4 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@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
2013-08-20 13:40:02 -07:00
Ben Pfaff
f4aa1da85a seq: Initialize 'ovsthread_id' member of waiters in seq_wait__().
Found by valgrind.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
2013-08-16 11:20:57 -07:00
Ben Pfaff
5d389d55c7 seq: Add some comments.
Signed-off-by: Ben Pfaff <blp@nicira.com>
2013-08-12 13:59:02 -07:00
Ben Pfaff
55b403558b seq: New module for race-free, pollable, thread-safe sequence number.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
2013-08-10 20:48:58 -07:00