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
5ab4c314
Commit
5ab4c314
authored
Aug 28, 2018
by
Poul-Henning Kamp
Committed by
Dridi Boukelmoune
Oct 16, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Collect and make explicit where we enter and leave "tasks" for
the purpose of VRT_priv_task()
parent
4ecbafdd
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
44 additions
and
36 deletions
+44
-36
cache_busyobj.c
bin/varnishd/cache/cache_busyobj.c
+1
-5
cache_esi_deliver.c
bin/varnishd/cache/cache_esi_deliver.c
+0
-3
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+2
-0
cache_req.c
bin/varnishd/cache/cache_req.c
+3
-13
cache_req_fsm.c
bin/varnishd/cache/cache_req_fsm.c
+4
-0
cache_varnishd.h
bin/varnishd/cache/cache_varnishd.h
+2
-1
cache_vcl_vrt.c
bin/varnishd/cache/cache_vcl_vrt.c
+2
-11
cache_vrt.c
bin/varnishd/cache/cache_vrt.c
+2
-1
cache_vrt_priv.c
bin/varnishd/cache/cache_vrt_priv.c
+28
-0
cache_http1_fsm.c
bin/varnishd/http1/cache_http1_fsm.c
+0
-1
cache_http2_proto.c
bin/varnishd/http2/cache_http2_proto.c
+0
-1
No files found.
bin/varnishd/cache/cache_busyobj.c
View file @
5ab4c314
...
...
@@ -133,14 +133,11 @@ VBO_GetBusyObj(struct worker *wrk, const struct req *req)
bo
->
director_req
=
req
->
director_hint
;
bo
->
vcl
=
req
->
vcl
;
VCL_Ref
(
bo
->
vcl
);
VCL_Onboard
(
NULL
,
bo
);
bo
->
t_first
=
bo
->
t_prev
=
NAN
;
memcpy
(
bo
->
digest
,
req
->
digest
,
sizeof
bo
->
digest
);
VRTPRIV_init
(
bo
->
privs
);
return
(
bo
);
}
...
...
@@ -156,8 +153,7 @@ VBO_ReleaseBusyObj(struct worker *wrk, struct busyobj **pbo)
AZ
(
bo
->
htc
);
AZ
(
bo
->
stale_oc
);
VRTPRIV_dynamic_kill
(
bo
->
privs
,
(
uintptr_t
)
bo
);
assert
(
VTAILQ_EMPTY
(
&
bo
->
privs
->
privs
));
AZ
(
bo
->
privs
->
magic
);
VSLb
(
bo
->
vsl
,
SLT_BereqAcct
,
"%ju %ju %ju %ju %ju %ju"
,
(
uintmax_t
)
bo
->
acct
.
bereq_hdrbytes
,
...
...
bin/varnishd/cache/cache_esi_deliver.c
View file @
5ab4c314
...
...
@@ -164,7 +164,6 @@ ved_include(struct req *preq, const char *src, const char *host,
AZ
(
req
->
vcl
);
req
->
vcl
=
preq
->
vcl
;
preq
->
vcl
=
NULL
;
VCL_Onboard
(
req
,
NULL
);
req
->
req_step
=
R_STP_RECV
;
req
->
t_req
=
preq
->
t_req
;
...
...
@@ -198,8 +197,6 @@ ved_include(struct req *preq, const char *src, const char *host,
AZ
(
req
->
wrk
);
}
VRTPRIV_dynamic_kill
(
req
->
privs
,
(
uintptr_t
)
req
);
AZ
(
preq
->
vcl
);
preq
->
vcl
=
req
->
vcl
;
req
->
vcl
=
NULL
;
...
...
bin/varnishd/cache/cache_fetch.c
View file @
5ab4c314
...
...
@@ -900,6 +900,7 @@ vbf_fetch_thread(struct worker *wrk, void *priv)
}
#endif
VCL_TaskEnter
(
bo
->
vcl
,
bo
->
privs
);
while
(
stp
!=
F_STP_DONE
)
{
CHECK_OBJ_NOTNULL
(
bo
,
BUSYOBJ_MAGIC
);
assert
(
bo
->
fetch_objcore
->
boc
->
refcount
>=
1
);
...
...
@@ -920,6 +921,7 @@ vbf_fetch_thread(struct worker *wrk, void *priv)
assert
(
bo
->
director_state
==
DIR_S_NULL
);
VCL_TaskLeave
(
bo
->
vcl
,
bo
->
privs
);
http_Teardown
(
bo
->
bereq
);
http_Teardown
(
bo
->
beresp
);
...
...
bin/varnishd/cache/cache_req.c
View file @
5ab4c314
...
...
@@ -149,8 +149,6 @@ Req_New(const struct worker *wrk, struct sess *sp)
req
->
t_prev
=
NAN
;
req
->
t_req
=
NAN
;
VRTPRIV_init
(
req
->
privs
);
return
(
req
);
}
...
...
@@ -181,14 +179,6 @@ Req_Release(struct req *req)
MPL_Free
(
pp
->
mpl_req
,
req
);
}
static
void
req_finalize
(
struct
req
*
req
)
{
VRTPRIV_dynamic_kill
(
req
->
privs
,
(
uintptr_t
)
req
);
VRTPRIV_dynamic_kill
(
req
->
privs
,
(
uintptr_t
)
&
req
->
top
);
assert
(
VTAILQ_EMPTY
(
&
req
->
privs
->
privs
));
}
/*----------------------------------------------------------------------
* TODO:
* - check for code duplication with cnt_recv_prep
...
...
@@ -198,7 +188,8 @@ req_finalize(struct req *req)
void
Req_Rollback
(
struct
req
*
req
)
{
req_finalize
(
req
);
VCL_TaskLeave
(
req
->
vcl
,
req
->
privs
);
VCL_TaskEnter
(
req
->
vcl
,
req
->
privs
);
HTTP_Copy
(
req
->
http
,
req
->
http0
);
WS_Reset
(
req
->
ws
,
req
->
ws_req
);
}
...
...
@@ -220,6 +211,7 @@ Req_Cleanup(struct sess *sp, struct worker *wrk, struct req *req)
req
->
restarts
=
0
;
AZ
(
req
->
esi_level
);
AZ
(
req
->
privs
->
magic
);
assert
(
req
->
top
==
req
);
if
(
req
->
vcl
!=
NULL
)
{
...
...
@@ -229,8 +221,6 @@ Req_Cleanup(struct sess *sp, struct worker *wrk, struct req *req)
req
->
vcl
=
NULL
;
}
req_finalize
(
req
);
/* Charge and log byte counters */
if
(
req
->
vsl
->
wid
)
{
Req_AcctLogCharge
(
wrk
->
stats
,
req
);
...
...
bin/varnishd/cache/cache_req_fsm.c
View file @
5ab4c314
...
...
@@ -1023,6 +1023,7 @@ CNT_Request(struct worker *wrk, struct req *req)
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
AN
(
req
->
vcl
);
/*
* Possible entrance states
...
...
@@ -1037,6 +1038,8 @@ CNT_Request(struct worker *wrk, struct req *req)
/* wrk can have changed for restarts */
req
->
vfc
->
wrk
=
req
->
wrk
=
wrk
;
wrk
->
vsl
=
req
->
vsl
;
if
(
req
->
req_step
!=
R_STP_LOOKUP
)
VCL_TaskEnter
(
req
->
vcl
,
req
->
privs
);
for
(
nxt
=
REQ_FSM_MORE
;
nxt
==
REQ_FSM_MORE
;
)
{
/*
* This is a good place to be paranoid about the various
...
...
@@ -1061,6 +1064,7 @@ CNT_Request(struct worker *wrk, struct req *req)
}
wrk
->
vsl
=
NULL
;
if
(
nxt
==
REQ_FSM_DONE
)
{
VCL_TaskLeave
(
req
->
vcl
,
req
->
privs
);
AN
(
req
->
vsl
->
wid
);
VRB_Free
(
req
);
req
->
wrk
=
NULL
;
...
...
bin/varnishd/cache/cache_varnishd.h
View file @
5ab4c314
...
...
@@ -387,7 +387,8 @@ void VCL_Poll(void);
void
VCL_Ref
(
struct
vcl
*
);
void
VCL_Refresh
(
struct
vcl
**
);
void
VCL_Rel
(
struct
vcl
**
);
void
VCL_Onboard
(
const
struct
req
*
,
const
struct
busyobj
*
);
void
VCL_TaskEnter
(
struct
vcl
*
,
struct
vrt_privs
*
);
void
VCL_TaskLeave
(
struct
vcl
*
,
struct
vrt_privs
*
);
const
char
*
VCL_Return_Name
(
unsigned
);
const
char
*
VCL_Method_Name
(
unsigned
);
void
VCL_Bo2Ctx
(
struct
vrt_ctx
*
,
struct
busyobj
*
);
...
...
bin/varnishd/cache/cache_vcl_vrt.c
View file @
5ab4c314
...
...
@@ -73,16 +73,6 @@ VCL_Method_Name(unsigned m)
/*--------------------------------------------------------------------*/
void
VCL_Onboard
(
const
struct
req
*
req
,
const
struct
busyobj
*
bo
)
{
CHECK_OBJ_ORNULL
(
req
,
REQ_MAGIC
);
CHECK_OBJ_ORNULL
(
bo
,
BUSYOBJ_MAGIC
);
assert
(
req
!=
NULL
||
bo
!=
NULL
);
assert
(
req
==
NULL
||
bo
==
NULL
);
}
void
VCL_Refresh
(
struct
vcl
**
vcc
)
{
...
...
@@ -271,11 +261,12 @@ VRT_vcl_select(VRT_CTX, VCL_VCL vcl)
struct
req
*
req
=
ctx
->
req
;
CHECK_OBJ_NOTNULL
(
vcl
,
VCL_MAGIC
);
VCL_TaskLeave
(
req
->
vcl
,
req
->
privs
);
VCL_Rel
(
&
req
->
vcl
);
vcl_get
(
&
req
->
vcl
,
vcl
);
/* XXX: better logging */
VSLb
(
ctx
->
req
->
vsl
,
SLT_Debug
,
"Now using %s VCL"
,
vcl
->
loaded_name
);
VCL_
Onboard
(
req
,
NULL
);
VCL_
TaskEnter
(
req
->
vcl
,
req
->
privs
);
}
struct
vclref
*
...
...
bin/varnishd/cache/cache_vrt.c
View file @
5ab4c314
...
...
@@ -523,7 +523,8 @@ VRT_Rollback(VRT_CTX, VCL_HTTP hp)
}
else
if
(
hp
==
ctx
->
http_bereq
)
{
CHECK_OBJ_NOTNULL
(
ctx
->
bo
,
BUSYOBJ_MAGIC
);
// -> VBO_Rollback ?
VRTPRIV_dynamic_kill
(
ctx
->
bo
->
privs
,
(
uintptr_t
)
ctx
->
bo
);
VCL_TaskLeave
(
ctx
->
bo
->
vcl
,
ctx
->
bo
->
privs
);
VCL_TaskEnter
(
ctx
->
bo
->
vcl
,
ctx
->
bo
->
privs
);
HTTP_Copy
(
ctx
->
bo
->
bereq
,
ctx
->
bo
->
bereq0
);
WS_Reset
(
ctx
->
bo
->
bereq
->
ws
,
ctx
->
bo
->
ws_bo
);
WS_Reset
(
ctx
->
bo
->
ws
,
ctx
->
bo
->
ws_bo
);
...
...
bin/varnishd/cache/cache_vrt_priv.c
View file @
5ab4c314
...
...
@@ -190,3 +190,31 @@ VRT_priv_fini(const struct vmod_priv *p)
if
(
p
->
priv
!=
NULL
&&
p
->
free
!=
NULL
)
p
->
free
(
p
->
priv
);
}
/*--------------------------------------------------------------------*/
void
VCL_TaskEnter
(
struct
vcl
*
vcl
,
struct
vrt_privs
*
privs
)
{
VSL
(
SLT_Debug
,
0
,
"%s %p %p %u"
,
__func__
,
vcl
,
privs
,
privs
->
magic
);
AN
(
vcl
);
AZ
(
privs
->
magic
);
VRTPRIV_init
(
privs
);
}
void
VCL_TaskLeave
(
struct
vcl
*
vcl
,
struct
vrt_privs
*
privs
)
{
struct
vrt_priv
*
vp
,
*
vp1
;
AN
(
vcl
);
VSL
(
SLT_Debug
,
0
,
"%s %p %p %u"
,
__func__
,
vcl
,
privs
,
privs
->
magic
);
CHECK_OBJ_NOTNULL
(
privs
,
VRT_PRIVS_MAGIC
);
VTAILQ_FOREACH_SAFE
(
vp
,
&
privs
->
privs
,
list
,
vp1
)
{
VTAILQ_REMOVE
(
&
privs
->
privs
,
vp
,
list
);
VRT_priv_fini
(
vp
->
priv
);
}
INIT_OBJ
(
privs
,
0
);
}
bin/varnishd/http1/cache_http1_fsm.c
View file @
5ab4c314
...
...
@@ -286,7 +286,6 @@ http1_dissect(struct worker *wrk, struct req *req)
VCL_Refresh
(
&
wrk
->
vcl
);
req
->
vcl
=
wrk
->
vcl
;
wrk
->
vcl
=
NULL
;
VCL_Onboard
(
req
,
NULL
);
HTTP_Setup
(
req
->
http
,
req
->
ws
,
req
->
vsl
,
SLT_ReqMethod
);
req
->
err_code
=
HTTP1_DissectRequest
(
req
->
htc
,
req
->
http
);
...
...
bin/varnishd/http2/cache_http2_proto.c
View file @
5ab4c314
...
...
@@ -643,7 +643,6 @@ h2_rx_headers(struct worker *wrk, struct h2_sess *h2, struct h2_req *r2)
VCL_Refresh
(
&
wrk
->
vcl
);
req
->
vcl
=
wrk
->
vcl
;
wrk
->
vcl
=
NULL
;
VCL_Onboard
(
req
,
NULL
);
req
->
acct
.
req_hdrbytes
+=
h2
->
rxf_len
;
HTTP_Setup
(
req
->
http
,
req
->
ws
,
req
->
vsl
,
SLT_ReqMethod
);
...
...
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