/*
- * $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
* turnarounds)
*/
heap_key
-HeapKeyGen_StoreEntry_LFUDA(void *entry, double age)
+HeapKeyGen_StoreEntry_LFUDA(void *entry, double heap_age)
{
StoreEntry *e = entry;
heap_key key;
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);
* 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);
* 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);
/*
- * $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/
* ----------------------------------------------------------