Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
ed4ed27f
Commit
ed4ed27f
authored
Dec 03, 2018
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce HSH_HITPASS and HSH_HITMISS and clarify grace/keep HSH_HITMISS
parent
9cb08c1d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
16 deletions
+26
-16
cache_hash.c
bin/varnishd/cache/cache_hash.c
+10
-4
cache_req_fsm.c
bin/varnishd/cache/cache_req_fsm.c
+14
-12
hash_slinger.h
bin/varnishd/hash/hash_slinger.h
+2
-0
No files found.
bin/varnishd/cache/cache_hash.c
View file @
ed4ed27f
...
@@ -444,14 +444,14 @@ HSH_Lookup(struct req *req, struct objcore **ocp, struct objcore **bocp,
...
@@ -444,14 +444,14 @@ HSH_Lookup(struct req *req, struct objcore **ocp, struct objcore **bocp,
VSLb
(
req
->
vsl
,
SLT_HitPass
,
"%u %.6f"
,
VSLb
(
req
->
vsl
,
SLT_HitPass
,
"%u %.6f"
,
ObjGetXID
(
wrk
,
oc
),
EXP_Dttl
(
req
,
oc
));
ObjGetXID
(
wrk
,
oc
),
EXP_Dttl
(
req
,
oc
));
oc
=
NULL
;
oc
=
NULL
;
retval
=
HSH_
MI
SS
;
retval
=
HSH_
HITPA
SS
;
}
else
if
(
oc
->
flags
&
OC_F_HFM
)
{
}
else
if
(
oc
->
flags
&
OC_F_HFM
)
{
wrk
->
stats
->
cache_hitmiss
++
;
wrk
->
stats
->
cache_hitmiss
++
;
VSLb
(
req
->
vsl
,
SLT_HitMiss
,
"%u %.6f"
,
VSLb
(
req
->
vsl
,
SLT_HitMiss
,
"%u %.6f"
,
ObjGetXID
(
wrk
,
oc
),
EXP_Dttl
(
req
,
oc
));
ObjGetXID
(
wrk
,
oc
),
EXP_Dttl
(
req
,
oc
));
*
bocp
=
hsh_insert_busyobj
(
wrk
,
oh
);
*
bocp
=
hsh_insert_busyobj
(
wrk
,
oh
);
oc
->
refcnt
++
;
oc
->
refcnt
++
;
retval
=
HSH_MISS
;
retval
=
HSH_
HIT
MISS
;
}
else
{
}
else
{
oc
->
refcnt
++
;
oc
->
refcnt
++
;
if
(
oc
->
hits
<
LONG_MAX
)
if
(
oc
->
hits
<
LONG_MAX
)
...
@@ -473,11 +473,17 @@ HSH_Lookup(struct req *req, struct objcore **ocp, struct objcore **bocp,
...
@@ -473,11 +473,17 @@ HSH_Lookup(struct req *req, struct objcore **ocp, struct objcore **bocp,
}
}
if
(
exp_oc
!=
NULL
&&
exp_oc
->
flags
&
OC_F_HFM
)
{
if
(
exp_oc
!=
NULL
&&
exp_oc
->
flags
&
OC_F_HFM
)
{
/*
* expired HFM ("grace/keep HFM")
*
* XXX should HFM objects actually have grace/keep ?
*/
wrk
->
stats
->
cache_hitmiss
++
;
wrk
->
stats
->
cache_hitmiss
++
;
VSLb
(
req
->
vsl
,
SLT_HitMiss
,
"%u %.6f"
,
ObjGetXID
(
wrk
,
exp_oc
),
VSLb
(
req
->
vsl
,
SLT_HitMiss
,
"%u %.6f"
,
ObjGetXID
(
wrk
,
exp_oc
),
EXP_Dttl
(
req
,
exp_oc
));
EXP_Dttl
(
req
,
exp_oc
));
exp_oc
=
NULL
;
*
bocp
=
hsh_insert_busyobj
(
wrk
,
oh
);
busy_found
=
0
;
Lck_Unlock
(
&
oh
->
mtx
);
return
(
HSH_HITMISS
);
}
}
if
(
!
busy_found
)
{
if
(
!
busy_found
)
{
...
...
bin/varnishd/cache/cache_req_fsm.c
View file @
ed4ed27f
...
@@ -503,21 +503,23 @@ cnt_lookup(struct worker *wrk, struct req *req)
...
@@ -503,21 +503,23 @@ cnt_lookup(struct worker *wrk, struct req *req)
}
}
AZ
(
req
->
objcore
);
AZ
(
req
->
objcore
);
if
(
lr
==
HSH_MISS
)
{
if
(
lr
==
HSH_MISS
||
lr
==
HSH_HITMISS
)
{
if
(
busy
!=
NULL
)
{
AN
(
busy
);
/* hitmiss, out-of-grace or ordinary miss */
AN
(
busy
->
flags
&
OC_F_BUSY
);
AN
(
busy
->
flags
&
OC_F_BUSY
)
;
req
->
objcore
=
busy
;
req
->
objcore
=
busy
;
req
->
stale_oc
=
oc
;
req
->
stale_oc
=
oc
;
req
->
req_step
=
R_STP_MISS
;
req
->
req_step
=
R_STP_MISS
;
return
(
REQ_FSM_MORE
)
;
}
else
{
}
/* hitpass */
if
(
lr
==
HSH_HITPASS
)
{
AZ
(
oc
);
AZ
(
busy
);
req
->
req_step
=
R_STP_PASS
;
AZ
(
oc
)
;
}
req
->
req_step
=
R_STP_PASS
;
return
(
REQ_FSM_MORE
);
return
(
REQ_FSM_MORE
);
}
}
assert
(
lr
==
HSH_HIT
||
lr
==
HSH_GRACE
);
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
AZ
(
oc
->
flags
&
OC_F_BUSY
);
AZ
(
oc
->
flags
&
OC_F_BUSY
);
req
->
objcore
=
oc
;
req
->
objcore
=
oc
;
...
...
bin/varnishd/hash/hash_slinger.h
View file @
ed4ed27f
...
@@ -53,6 +53,8 @@ enum lookup_e {
...
@@ -53,6 +53,8 @@ enum lookup_e {
HSH_MISS
,
HSH_MISS
,
HSH_BUSY
,
HSH_BUSY
,
HSH_HIT
,
HSH_HIT
,
HSH_HITMISS
,
HSH_HITPASS
,
HSH_GRACE
HSH_GRACE
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment