From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13161 invoked by alias); 10 Nov 2009 21:35:13 -0000 Received: (qmail 13152 invoked by uid 22791); 10 Nov 2009 21:35:12 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from smtp-outbound-2.vmware.com (HELO smtp-outbound-2.vmware.com) (65.115.85.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 10 Nov 2009 21:35:08 +0000 Received: from mailhost2.vmware.com (mailhost2.vmware.com [10.16.67.167]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 569D2E06F; Tue, 10 Nov 2009 13:35:07 -0800 (PST) Received: from [10.20.94.141] (msnyder-server.eng.vmware.com [10.20.94.141]) by mailhost2.vmware.com (Postfix) with ESMTP id 4AD1E8E70F; Tue, 10 Nov 2009 13:35:07 -0800 (PST) Message-ID: <4AF9DC39.7030207@vmware.com> Date: Tue, 10 Nov 2009 21:35:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20090624) MIME-Version: 1.0 To: "gdb-patches@sourceware.org" , Doug Evans , jdpotter@google.com Subject: [RFA] dcache invalidate fix Content-Type: multipart/mixed; boundary="------------030604090906010907020808" X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-11/txt/msg00233.txt.bz2 This is a multi-part message in MIME format. --------------030604090906010907020808 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 363 Doug, I'm vague about this, but it seems right and it fixes the bug that I'm running into. It seems like dcache_invalidate_line needs to remove the block from the in use list at the same time as adding it to the freed list. The problem that bit me was getting the two lists cross-linked, which eventually led to an infinite loop behavior in dcache_invalidate. --------------030604090906010907020808 Content-Type: text/plain; name="dcache2.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="dcache2.txt" Content-length: 889 2009-11-10 Michael Snyder * dcache.c (dcache_invalidate_line): Remove block from used list when adding it to freed list. Index: dcache.c =================================================================== RCS file: /cvs/src/src/gdb/dcache.c,v retrieving revision 1.37 diff -u -p -r1.37 dcache.c --- dcache.c 10 Nov 2009 18:36:50 -0000 1.37 +++ dcache.c 10 Nov 2009 21:31:03 -0000 @@ -167,10 +167,18 @@ dcache_invalidate_line (DCACHE *dcache, if (db) { + struct dcache_block *db2; splay_tree_remove (dcache->tree, (splay_tree_key) db->addr); db->newer = dcache->freelist; dcache->freelist = db; --dcache->size; + /* Remove db from dcache in-use chain. */ + for (db2 = dcache->oldest; db2; db2 = db2->newer) + if (db2->newer == db) + { + dcache->newest = db2; + db2->newer = NULL; + } } } --------------030604090906010907020808--