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
ed47f83d
Commit
ed47f83d
authored
Sep 03, 2012
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move the busyobj allocation from cache_hash to cache_req_fsm
Move the predictive vary from the req->ws to busyobj->ws.
parent
5922eb75
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
27 deletions
+20
-27
cache_hash.c
bin/varnishd/cache/cache_hash.c
+0
-14
cache_req_fsm.c
bin/varnishd/cache/cache_req_fsm.c
+20
-13
No files found.
bin/varnishd/cache/cache_hash.c
View file @
ed47f83d
...
...
@@ -60,7 +60,6 @@
#include "hash/hash_slinger.h"
#include "vmb.h"
#include "vsha256.h"
static
const
struct
hash_slinger
*
hash
;
...
...
@@ -445,19 +444,6 @@ HSH_Lookup(struct req *req)
VTAILQ_INSERT_TAIL
(
&
oh
->
objcs
,
oc
,
list
);
/* NB: do not deref objhead the new object inherits our reference */
Lck_Unlock
(
&
oh
->
mtx
);
AZ
(
req
->
busyobj
);
req
->
busyobj
=
VBO_GetBusyObj
(
wrk
);
req
->
busyobj
->
refcount
=
2
;
/* One for req, one for FetchBody */
VRY_Validate
(
req
->
vary_b
);
if
(
req
->
vary_l
!=
NULL
)
req
->
busyobj
->
vary
=
req
->
vary_b
;
else
req
->
busyobj
->
vary
=
NULL
;
VMB
();
oc
->
busyobj
=
req
->
busyobj
;
return
(
oc
);
}
...
...
bin/varnishd/cache/cache_req_fsm.c
View file @
ed47f83d
...
...
@@ -776,6 +776,7 @@ cnt_lookup(struct worker *wrk, struct req *req)
struct
objcore
*
oc
;
struct
object
*
o
;
struct
objhead
*
oh
;
struct
busyobj
*
bo
;
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
...
...
@@ -792,8 +793,8 @@ cnt_lookup(struct worker *wrk, struct req *req)
/*
* We lost the session to a busy object, disembark the
* worker thread. We return to STP_LOOKUP when the busy
* object has been unbusied, and still have the
hash digest
* around to
do
the lookup with.
* object has been unbusied, and still have the
objhead
* around to
restart
the lookup with.
*/
return
(
2
);
}
...
...
@@ -805,22 +806,28 @@ cnt_lookup(struct worker *wrk, struct req *req)
/* If we inserted a new object it's a miss */
if
(
oc
->
flags
&
OC_F_BUSY
)
{
CHECK_OBJ_NOTNULL
(
oc
->
busyobj
,
BUSYOBJ_MAGIC
);
assert
(
oc
->
busyobj
==
req
->
busyobj
);
wrk
->
stats
.
cache_miss
++
;
AZ
(
req
->
busyobj
);
bo
=
VBO_GetBusyObj
(
wrk
);
req
->
busyobj
=
bo
;
/* One ref for req, one for FetchBody */
bo
->
refcount
=
2
;
VRY_Validate
(
req
->
vary_b
);
if
(
req
->
vary_l
!=
NULL
)
{
assert
(
oc
->
busyobj
->
vary
==
req
->
vary_b
);
VRY_Validate
(
oc
->
busyobj
->
vary
);
WS_ReleaseP
(
req
->
ws
,
(
void
*
)
req
->
vary_l
);
}
else
{
AZ
(
oc
->
busyobj
->
vary
);
WS_Release
(
req
->
ws
,
0
);
}
bo
->
vary
=
(
void
*
)
WS_Copy
(
bo
->
ws
,
(
void
*
)
req
->
vary_b
,
req
->
vary_l
-
req
->
vary_b
);
AN
(
bo
->
vary
);
VRY_Validate
(
bo
->
vary
);
}
else
bo
->
vary
=
NULL
;
WS_Release
(
req
->
ws
,
0
);
req
->
vary_b
=
NULL
;
req
->
vary_l
=
NULL
;
req
->
vary_e
=
NULL
;
oc
->
busyobj
=
bo
;
wrk
->
stats
.
cache_miss
++
;
req
->
objcore
=
oc
;
req
->
req_step
=
R_STP_MISS
;
return
(
0
);
...
...
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