Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@vmware.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	  Doug Evans <dje@google.com>,
	  jdpotter@google.com
Subject: [RFA] dcache invalidate fix
Date: Tue, 10 Nov 2009 21:35:00 -0000	[thread overview]
Message-ID: <4AF9DC39.7030207@vmware.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 363 bytes --]

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.


[-- Attachment #2: dcache2.txt --]
[-- Type: text/plain, Size: 889 bytes --]

2009-11-10  Michael Snyder  <msnyder@vmware.com>

	* 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;
+	  }
     }
 }
 

             reply	other threads:[~2009-11-10 21:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-10 21:35 Michael Snyder [this message]
2009-11-11 23:37 ` Doug Evans
2009-11-12  0:06   ` Michael Snyder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AF9DC39.7030207@vmware.com \
    --to=msnyder@vmware.com \
    --cc=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jdpotter@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox