Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 02 Jul 2012 13:09:47 +0000
From:      gmiller@FreeBSD.org
To:        svn-soc-all@FreeBSD.org
Subject:   socsvn commit: r238802 - in soc2012/gmiller/locking-head: . lib/libwitness
Message-ID:  <20120702130947.EEE36106567C@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help
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@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);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120702130947.EEE36106567C>