]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Changed "age" to "heap_age" to avoid confustion.
authorhno <>
Mon, 8 Apr 2002 15:03:17 +0000 (15:03 +0000)
committerhno <>
Mon, 8 Apr 2002 15:03:17 +0000 (15:03 +0000)
Extended the "lost attribution" to include a reference to the heap paper

src/repl/heap/store_heap_replacement.cc
src/repl/heap/store_repl_heap.cc

index f99820ad019e2c59fb71bf2249dccfd2952361e6..a6841c623b38be3121a111ab0254f7198d7529e9 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_heap_replacement.cc,v 1.7 2001/10/24 05:26:22 hno Exp $
+ * $Id: store_heap_replacement.cc,v 1.8 2002/04/08 09:03:17 hno Exp $
  *
  * DEBUG: section 20    Storage Manager Heap-based replacement
  * AUTHOR: John Dilley
@@ -66,7 +66,7 @@
  * turnarounds)
  */
 heap_key
-HeapKeyGen_StoreEntry_LFUDA(void *entry, double age)
+HeapKeyGen_StoreEntry_LFUDA(void *entry, double heap_age)
 {
     StoreEntry *e = entry;
     heap_key key;
@@ -77,9 +77,9 @@ HeapKeyGen_StoreEntry_LFUDA(void *entry, double age)
        tie = 0.0;
     else
        tie = 1.0 - exp((double) (e->lastref - squid_curtime) / 86400.0);
-    key = age + (double) e->refcount - tie;
-    debug(81, 3) ("HeapKeyGen_StoreEntry_LFUDA: %s refcnt=%d lastref=%ld age=%f tie=%f -> %f\n",
-       storeKeyText(e->hash.key), (int)e->refcount, e->lastref, age, tie, key);
+    key = heap_age + (double) e->refcount - tie;
+    debug(81, 3) ("HeapKeyGen_StoreEntry_LFUDA: %s refcnt=%d lastref=%ld heap_age=%f tie=%f -> %f\n",
+       storeKeyText(e->hash.key), (int)e->refcount, e->lastref, heap_age, tie, key);
     if (e->mem_obj && e->mem_obj->url)
        debug(81, 3) ("HeapKeyGen_StoreEntry_LFUDA: url=%s\n",
            e->mem_obj->url);
@@ -107,15 +107,15 @@ HeapKeyGen_StoreEntry_LFUDA(void *entry, double age)
  * turnarounds)
  */
 heap_key
-HeapKeyGen_StoreEntry_GDSF(void *entry, double age)
+HeapKeyGen_StoreEntry_GDSF(void *entry, double heap_age)
 {
     StoreEntry *e = entry;
     heap_key key;
     double size = e->swap_file_sz ? (double) e->swap_file_sz : 1.0;
     double tie = (e->lastref > 1) ? (1.0 / e->lastref) : 1.0;
-    key = age + ((double) e->refcount / size) - tie;
-    debug(81, 3) ("HeapKeyGen_StoreEntry_GDSF: %s size=%f refcnt=%d lastref=%ld age=%f tie=%f -> %f\n",
-       storeKeyText(e->hash.key), size, (int)e->refcount, e->lastref, age, tie, key);
+    key = heap_age + ((double) e->refcount / size) - tie;
+    debug(81, 3) ("HeapKeyGen_StoreEntry_GDSF: %s size=%f refcnt=%d lastref=%ld heap_age=%f tie=%f -> %f\n",
+       storeKeyText(e->hash.key), size, (int)e->refcount, e->lastref, heap_age, tie, key);
     if (e->mem_obj && e->mem_obj->url)
        debug(81, 3) ("HeapKeyGen_StoreEntry_GDSF: url=%s\n",
            e->mem_obj->url);
@@ -130,11 +130,11 @@ HeapKeyGen_StoreEntry_GDSF(void *entry, double age)
  * heap-based replacement policies...
  */
 heap_key
-HeapKeyGen_StoreEntry_LRU(void *entry, double age)
+HeapKeyGen_StoreEntry_LRU(void *entry, double heap_age)
 {
     StoreEntry *e = entry;
-    debug(81, 3) ("HeapKeyGen_StoreEntry_LRU: %s age=%f lastref=%f\n",
-       storeKeyText(e->hash.key), age, (double) e->lastref);
+    debug(81, 3) ("HeapKeyGen_StoreEntry_LRU: %s heap_age=%f lastref=%f\n",
+       storeKeyText(e->hash.key), heap_age, (double) e->lastref);
     if (e->mem_obj && e->mem_obj->url)
        debug(81, 3) ("HeapKeyGen_StoreEntry_LRU: url=%s\n",
            e->mem_obj->url);
index 252a211d0aea734b5eaf5b7749816041c9d51379..2737d42055874f38f0280fc83f620a7b0c5ad8ce 100644 (file)
@@ -1,13 +1,17 @@
 
 /*
- * $Id: store_repl_heap.cc,v 1.9 2002/04/08 08:48:47 hno Exp $
+ * $Id: store_repl_heap.cc,v 1.10 2002/04/08 09:03:17 hno Exp $
  *
  * DEBUG: section ?     HEAP based removal policies
  * AUTHOR: Henrik Nordstrom
  *
- * Based on the ideas of the HEAP policy implemented by John Dilley of
+ * Based on the ideas of the heap policy implemented by John Dilley of
  * Hewlett Packard. Rewritten from scratch when modularizing the removal
  * policy implementation of Squid.
+ *
+ * For details on the original heap policy work and the thinking behind see
+ * http://www.hpl.hp.com/techreports/1999/HPL-1999-69.html
+ *
  * 
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
  * ----------------------------------------------------------