]> err.no Git - varnish/commitdiff
Eliminate the parent-child linkage between objects involved in grace.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sat, 28 Feb 2009 17:20:19 +0000 (17:20 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sat, 28 Feb 2009 17:20:19 +0000 (17:20 +0000)
The original thinking was that only objects being prefetched were
relevant, but we take a more expansive view now.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3840 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache.h
varnish-cache/bin/varnishd/cache_hash.c

index deb98fafbf3f0b8e19ead3803ed9aebc588b9543..bae7680ba681d3e081095e4b58a2d6d8faad70b3 100644 (file)
@@ -330,10 +330,6 @@ struct object {
 
        double                  last_use;
 
-       /* Prefetch */
-       struct object           *parent;
-       struct object           *child;
-
        int                     hits;
 };
 
index afd3e2b3934aa74f829f4ce5216d7ba3fc1525ea..b35f2d8e3cbf62cd0a3844982fcf147600809aba 100644 (file)
@@ -330,11 +330,11 @@ HSH_Lookup(struct sess *sp)
                AN(o);
 
        /*
-        * If we have a object in grace and being fetched,
+        * If we have seen a busy object, and have an object in grace,
         * use it, if req.grace is also satisified.
         */
        if (o == NULL && grace_o != NULL &&
-           grace_o->child != NULL &&
+           busy_o != NULL &&
            grace_o->ttl + HSH_Grace(sp->grace) >= sp->t_req)
                o = grace_o;
 
@@ -374,11 +374,6 @@ HSH_Lookup(struct sess *sp)
        /* XXX: Should this not be ..._HEAD now ? */
        VTAILQ_INSERT_TAIL(&oh->objcs, oc, list);
        /* NB: do not deref objhead the new object inherits our reference */
-       if (grace_o != NULL) {
-               grace_o->child = o;
-               o->parent = grace_o;
-               grace_o->refcnt++;
-       }
        Lck_Unlock(&oh->mtx);
        /*
         * XXX: This may be too early, relative to pass objects.
@@ -432,7 +427,6 @@ HSH_Unbusy(const struct sess *sp)
 {
        struct object *o;
        struct objhead *oh;
-       struct object *parent;
 
        CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
        o = sp->obj;
@@ -453,14 +447,8 @@ HSH_Unbusy(const struct sess *sp)
        o->objcore->flags &= ~OC_F_BUSY;
        if (oh != NULL)
                hsh_rush(oh);
-       parent = o->parent;
-       o->parent = NULL;
-       if (parent != NULL)
-               parent->child = NULL;
        if (oh != NULL)
                Lck_Unlock(&oh->mtx);
-       if (parent != NULL)
-               HSH_Deref(sp->wrk, &parent);
 }
 
 void