Re: [Gems-users] Regarding leaking memory


Date: Tue, 16 Feb 2010 09:48:27 +0100
From: Javi Merino <merinocj@xxxxxxxxx>
Subject: Re: [Gems-users] Regarding leaking memory
I'm not very familiar with MOSI_SMP_bcast. Roughly, you have to call
freeBlock() in the setState() function of the directory when you know
the information of that particular block is no longer necessary. In a
directory protocol, that's usually when memory is owner and has an up to
date copy of the value.

I attach a patch that does that. It's untested, so it may molest your
pets! :)  Tell us if it worked, or what modifications are needed to make
MOSI_SMP_bcast free blocks.

Hope this helps,
Javi

sparsh mittal ISU wrote:
> Hello,
> I use MOSI_SMP_bcast protocol for simulations. In my long simulations,
> the memory usage of my simics/gems programs are quite large and so I
> am thinking of using patches suggested by Javier for ruby/system
> files.  However, would anyone tell , where should the freeBlock be
> called from, in MOSI_SMP_bcast, (if at all freeBlock can be used in
> this protocol) ? I would be thankful for the answer.
> Thanks 
> Sparsh
> 
> 
> _______________________________________________
> Gems-users mailing list
> Gems-users@xxxxxxxxxxx
> https://lists.cs.wisc.edu/mailman/listinfo/gems-users
> Use Google to search the GEMS Users mailing list by adding "site:https://lists.cs.wisc.edu/archive/gems-users/"; to your search.
> 

diff --git a/protocols/MOSI_SMP_bcast-dir.sm b/protocols/MOSI_SMP_bcast-dir.sm
--- a/protocols/MOSI_SMP_bcast-dir.sm
+++ b/protocols/MOSI_SMP_bcast-dir.sm
@@ -101,6 +101,7 @@ machine(Directory, "MOSI Broadcast Optim
 
   external_type(DirectoryMemory) {
     Entry lookup(Address);
+    void freeBlock(Address);
     bool isPresent(Address);
   }
 
@@ -120,6 +121,12 @@ machine(Directory, "MOSI Broadcast Optim
   void setState(Address addr, State state) {
     if (directory.isPresent(addr)) {
       directory[addr].DirectoryState := state;
+
+      if (directory[addr].DirOwner &&
+          ((state == State:C) || (state == State:I) ||
+          (state == State:S) || (state == State:SS))) {
+        directory.freeBlock(addr);
+      }
     }
   } 
 

Attachment: signature.asc
Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente

[← Prev in Thread] Current Thread [Next in Thread→]