[master] 94ec75e83 hash: Dropping an objcore does not rush the waiting list
Dridi Boukelmoune
dridi.boukelmoune at gmail.com
Wed Aug 27 15:23:06 UTC 2025
commit 94ec75e83998f9edcc79282cd4194c2e5dfda087
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date: Tue Dec 19 15:24:14 2023 +0100
hash: Dropping an objcore does not rush the waiting list
Rushing the waiting list because an objcore was dropped was a source
of spurious wakeups, including the case where the dropped objcore is not
even relevant to the objhead waiting list. It is now guaranteed that an
object either dropped its OC_F_BUSY flag once ready (otherwise failed or
withdrawn) or never had this flag to begin with for objcores that can't
be looked up.
diff --git a/bin/varnishd/cache/cache_hash.c b/bin/varnishd/cache/cache_hash.c
index 69c7da8fd..ad7063976 100644
--- a/bin/varnishd/cache/cache_hash.c
+++ b/bin/varnishd/cache/cache_hash.c
@@ -1145,13 +1145,13 @@ HSH_DerefObjCoreUnlock(struct worker *wrk, struct objcore **ocp, int rushmax)
{
struct objcore *oc;
struct objhead *oh;
- struct rush rush;
int r;
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
TAKE_OBJ_NOTNULL(oc, ocp, OBJCORE_MAGIC);
assert(oc->refcnt > 0);
- INIT_OBJ(&rush, RUSH_MAGIC);
+
+ (void)rushmax;
oh = oc->objhead;
CHECK_OBJ_NOTNULL(oh, OBJHEAD_MAGIC);
@@ -1161,15 +1161,11 @@ HSH_DerefObjCoreUnlock(struct worker *wrk, struct objcore **ocp, int rushmax)
r = --oc->refcnt;
if (!r)
VTAILQ_REMOVE(&oh->objcs, oc, hsh_list);
- if (!VTAILQ_EMPTY(&oh->waitinglist)) {
- assert(oh->refcnt > 1);
- hsh_rush1(wrk, oh, &rush, rushmax);
- }
Lck_Unlock(&oh->mtx);
- hsh_rush2(wrk, &rush);
if (r != 0)
return (r);
+ AZ(oc->flags & OC_F_BUSY);
AZ(oc->exp_flags);
BAN_DestroyObj(oc);
More information about the varnish-commit
mailing list