From owner-svn-soc-all@FreeBSD.ORG Mon Jul 2 13:09:50 2012 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from socsvn.FreeBSD.org (unknown [IPv6:2001:4f8:fff6::2f]) by hub.freebsd.org (Postfix) with SMTP id EEE36106567C for ; Mon, 2 Jul 2012 13:09:47 +0000 (UTC) (envelope-from gmiller@FreeBSD.org) Received: by socsvn.FreeBSD.org (sSMTP sendmail emulation); Mon, 02 Jul 2012 13:09:47 +0000 Date: Mon, 02 Jul 2012 13:09:47 +0000 From: gmiller@FreeBSD.org To: svn-soc-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <20120702130947.EEE36106567C@hub.freebsd.org> Cc: Subject: socsvn commit: r238802 - in soc2012/gmiller/locking-head: . lib/libwitness X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jul 2012 13:09:50 -0000 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); }