socsvn commit: r238802 - in soc2012/gmiller/locking-head: .
lib/libwitness
gmiller at FreeBSD.org
gmiller at FreeBSD.org
Mon Jul 2 13:09:50 UTC 2012
Author: gmiller
Date: Mon Jul 2 13:09:47 2012
New Revision: 238802
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=238802
Log:
r238615 at FreeBSD-dev: root | 2012-06-29 14:49:54 -0500
Begin adding code to maintain an optimized lock order graph.
Modified:
soc2012/gmiller/locking-head/ (props changed)
soc2012/gmiller/locking-head/lib/libwitness/graph.c
Modified: soc2012/gmiller/locking-head/lib/libwitness/graph.c
==============================================================================
--- soc2012/gmiller/locking-head/lib/libwitness/graph.c Mon Jul 2 13:09:38 2012 (r238801)
+++ soc2012/gmiller/locking-head/lib/libwitness/graph.c Mon Jul 2 13:09:47 2012 (r238802)
@@ -52,7 +52,17 @@
return (NULL);
}
-/* XXX: produces suboptimal graph, fix this before the end of the project */
+static void
+optimize_links(struct graph_node *to)
+{
+ to = to;
+ /*
+ find first node with multiple children, then start scanning for
+ multiple paths to "to" from any node with multiple children and
+ a link to "to"
+ */
+}
+
static int
insert_edge(struct graph_node *from, struct graph_node *to)
{
@@ -67,6 +77,8 @@
to->sibling = from->child;
from->child = to;
+ optimize_links(to);
+
return (0);
}
More information about the svn-soc-all
mailing list