Changes between Version 2 and Version 3 of StgObjectTypes


Ignore:
Timestamp:
May 22, 2006 10:30:25 AM (8 years ago)
Author:
guest
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • StgObjectTypes

    v2 v3  
    4848 * Avoid re-evaluation of the same think by mutliple threads 
    4949 
     50= Mutable List =  
     51The mutable list, sometimes referred to as the Remember Set is a list of pointer to objects in a generation that point to older generations. When a GC occurs till generation N, generations older than N are not traversed instead only the mutable lists of those generations are traversed to see what objects in the new generation are live because older generation objects point to them.  
     52 
     53 
     54A mutable list per generation is maintained by each capability. When GC starts, these are swept into each generation’s mut_list member and are traversed later. When garbage collecting only till generation N, mut lists of generations <=N are ignored (freed up) since we know that we are going to walk all the objects in those generations anyway.  
     55 
     56Certain object like MUT_ARR_PTRS_CLEAN and TSO are always on the mut list. In the case of some objects, walking the mut list does not let us take the objects off the mut list. Such objects are added back to the mut list (done by recordMutableGen).  
     57 
     58Objects that can be “cleaned” are cleaned by the function scavenge_one(). By cleaning we mean that the object in question no longer points to a newer generation object. This can be done only by moving the newer generation objects up to the generation where the original object resides. Code that does this for an object like a THUNK would look like this -  
     59 
     60{{{ 
     61end = (StgPtr)((StgClosure *)p)->payload + info->layout.payload.ptrs; 
     62for (q = (StgPtr)((StgClosure *)p)->payload; q < end; q++) { 
     63    *q = (StgWord)(StgPtr)evacuate((StgClosure *)*q); 
     64} 
     65}}} 
     66 
     67 
     68 
     69---- 
     70Questions 
     71 
     72 * Why is MUT_ARR_PTRS_CLEAN exist in the mut list always ? 
     73 * Why is failed_to_evac a global? 
     74 * Why do the steps get scavenged immediately after mut_list is scavenged? 
     75{{{ 
     76    for (g = RtsFlags.GcFlags.generations-1; g > N; g--) { 
     77      IF_PAR_DEBUG(verbose, printMutableList(&generations[g])); 
     78      scavenge_mutable_list(&generations[g]); 
     79      evac_gen = g; 
     80      for (st = generations[g].n_steps-1; st >= 0; st--) { 
     81        scavenge(&generations[g].steps[st]); 
     82      } 
     83    } 
     84}}} 
     85