Skip to content
This repository was archived by the owner on Feb 16, 2026. It is now read-only.

Commit 7fa30ba

Browse files
committed
cache_expire: move HSH_Kill() to exp_expire_oc()
This moves the HSH_kill() to after binheap removal, which makes no difference, other than prepare for batching, were it will be run outside the critical section.
1 parent a65f14f commit 7fa30ba

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

bin/varnishd/cache/cache_expire.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ exp_remove_oc(struct worker *wrk, struct objcore *oc, vtim_real now)
312312
/*--------------------------------------------------------------------
313313
* Finish expiry of an oc
314314
* This is subtly different from exp_remove_oc, also besides the VSL:
315+
* - additional HSH_Kill()
315316
* - assert ob objhead
316317
* - do not assert on exp_flags
317318
*/
@@ -322,6 +323,9 @@ exp_expire_oc(struct worker *wrk, struct vsl_log *vsl, struct objcore *oc, vtim_
322323

323324
CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC);
324325

326+
if (!(oc->flags & OC_F_DYING))
327+
HSH_Kill(oc);
328+
325329
assert(oc->timer_idx == VBH_NOIDX);
326330
assert(oc->refcnt > 0);
327331
// no exp_flags check
@@ -520,8 +524,6 @@ exp_expire(struct exp_priv *ep, vtim_real now)
520524
}
521525
Lck_Unlock(&ep->mtx);
522526
if (oc != NULL) {
523-
if (!(oc->flags & OC_F_DYING))
524-
HSH_Kill(oc);
525527

526528
/* Remove from binheap */
527529
assert(oc->timer_idx != VBH_NOIDX);

0 commit comments

Comments
 (0)