[master] 5c72666 Remove commented out EXP_NukeLRU(). We'll revisit this issue when we know what we're doing.
Poul-Henning Kamp
phk at FreeBSD.org
Thu Jun 26 09:06:23 CEST 2014
commit 5c7266623dcf4f23a2369c5faa32306e52cbeec0
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Thu Jun 26 07:05:59 2014 +0000
Remove commented out EXP_NukeLRU(). We'll revisit this issue when
we know what we're doing.
diff --git a/bin/varnishd/cache/cache_expire.c b/bin/varnishd/cache/cache_expire.c
index a893ecc..5f01f65 100644
--- a/bin/varnishd/cache/cache_expire.c
+++ b/bin/varnishd/cache/cache_expire.c
@@ -343,74 +343,6 @@ EXP_NukeOne(struct busyobj *bo, struct lru *lru)
}
/*--------------------------------------------------------------------
- * Nukes an entire LRU
- */
-
-#if 0 // Not yet
-
-#define NUKEBUF 10 /* XXX: Randomly chosen to be bigger than one */
-
-void
-EXP_NukeLRU(struct worker *wrk, struct vsl_log *vsl, struct lru *lru)
-{
- struct objcore *oc;
- struct objcore *oc_array[NUKEBUF];
- struct object *o;
- int i, n;
- double t;
-
- CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
- CHECK_OBJ_NOTNULL(lru, LRU_MAGIC);
-
- memset(oc_array, 0, sizeof oc_array);
-
- t = VTIM_real();
- Lck_Lock(&lru->mtx);
- while (!VTAILQ_EMPTY(&lru->lru_head)) {
- Lck_Lock(&exphdl->mtx);
- n = 0;
- while (n < NUKEBUF) {
- oc = VTAILQ_FIRST(&lru->lru_head);
- if (oc == NULL)
- break;
- CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC);
- assert(oc_getlru(oc) == lru);
-
- /* Remove from the LRU and binheap */
- VTAILQ_REMOVE(&lru->lru_head, oc, lru_list);
- assert(oc->timer_idx != BINHEAP_NOIDX);
- binheap_delete(exphdl->heap, oc->timer_idx);
- assert(oc->timer_idx == BINHEAP_NOIDX);
-
- oc_array[n++] = oc;
- VSC_C_main->n_lru_nuked++;
- }
- assert(n > 0);
- Lck_Unlock(&exphdl->mtx);
- Lck_Unlock(&lru->mtx);
-
- for (i = 0; i < n; i++) {
- oc = oc_array[i];
- o = oc_getobj(&wrk->stats, oc);
- /* XXX: Not documented in vsl_tags.h */
- VSLb(vsl, SLT_ExpKill, "x=%u t=%.0f LRU",
- oc_getxid(&wrk->stats, oc) & VSL_IDENTMASK,
- EXP_Ttl(NULL, o) - t);
- o->exp.ttl = 0.0;
- (void)HSH_DerefObjCore(&wrk->stats, &oc);
- }
-
- Lck_Lock(&lru->mtx);
- }
- Lck_Unlock(&lru->mtx);
-
- Pool_Sumstat(wrk);
-}
-
-#endif
-
-
-/*--------------------------------------------------------------------
* Handle stuff in the inbox
*/
More information about the varnish-commit
mailing list