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
9ed99f61
Commit
9ed99f61
authored
May 05, 2021
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move the worker vcl cache to the private part
parent
e3a6652c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
21 additions
and
22 deletions
+21
-22
cache.h
bin/varnishd/cache/cache.h
+0
-2
cache_acceptor.c
bin/varnishd/cache/cache_acceptor.c
+2
-2
cache_req_fsm.c
bin/varnishd/cache/cache_req_fsm.c
+3
-3
cache_varnishd.h
bin/varnishd/cache/cache_varnishd.h
+2
-1
cache_vrt_vcl.c
bin/varnishd/cache/cache_vrt_vcl.c
+5
-5
cache_wrk.c
bin/varnishd/cache/cache_wrk.c
+7
-7
cache_http2_session.c
bin/varnishd/http2/cache_http2_session.c
+2
-2
No files found.
bin/varnishd/cache/cache.h
View file @
9ed99f61
...
...
@@ -237,8 +237,6 @@ struct worker {
pthread_cond_t
cond
;
struct
vcl
*
vcl
;
struct
ws
aws
[
1
];
unsigned
cur_method
;
...
...
bin/varnishd/cache/cache_acceptor.c
View file @
9ed99f61
...
...
@@ -445,8 +445,8 @@ vca_accept_task(struct worker *wrk, void *arg)
VTIM_sleep
(.
1
);
/* Dont hold on to (possibly) discarded VCLs */
if
(
wrk
->
vcl
!=
NULL
)
VCL_Rel
(
&
wrk
->
vcl
);
if
(
wrk
->
wpriv
->
vcl
!=
NULL
)
VCL_Rel
(
&
wrk
->
wpriv
->
vcl
);
while
(
!
ps
->
pool
->
die
)
{
INIT_OBJ
(
&
wa
,
WRK_ACCEPT_MAGIC
);
...
...
bin/varnishd/cache/cache_req_fsm.c
View file @
9ed99f61
...
...
@@ -1097,9 +1097,9 @@ CNT_Embark(struct worker *wrk, struct req *req)
req
->
vfc
->
wrk
=
req
->
wrk
=
wrk
;
wrk
->
vsl
=
req
->
vsl
;
if
(
req
->
req_step
==
R_STP_TRANSPORT
&&
req
->
vcl
==
NULL
)
{
VCL_Refresh
(
&
wrk
->
vcl
);
req
->
vcl
=
wrk
->
vcl
;
wrk
->
vcl
=
NULL
;
VCL_Refresh
(
&
wrk
->
wpriv
->
vcl
);
req
->
vcl
=
wrk
->
wpriv
->
vcl
;
wrk
->
wpriv
->
vcl
=
NULL
;
VSLb
(
req
->
vsl
,
SLT_VCL_use
,
"%s"
,
VCL_Name
(
req
->
vcl
));
}
...
...
bin/varnishd/cache/cache_varnishd.h
View file @
9ed99f61
...
...
@@ -81,6 +81,7 @@ struct worker_priv {
struct
objcore
*
nobjcore
;
void
*
nhashpriv
;
struct
vxid_pool
vxid_pool
[
1
];
struct
vcl
*
vcl
;
};
/*--------------------------------------------------------------------
...
...
@@ -480,7 +481,7 @@ void VCL_VRT_Init(void);
const
char
*
VCL_Return_Name
(
unsigned
);
const
char
*
VCL_Method_Name
(
unsigned
);
void
VCL_Refresh
(
struct
vcl
**
);
void
VCL_Recache
(
struct
worker
*
,
struct
vcl
**
);
void
VCL_Recache
(
const
struct
worker
*
,
struct
vcl
**
);
void
VCL_Ref
(
struct
vcl
*
);
void
VCL_Rel
(
struct
vcl
**
);
VCL_BACKEND
VCL_DefaultDirector
(
const
struct
vcl
*
);
...
...
bin/varnishd/cache/cache_vrt_vcl.c
View file @
9ed99f61
...
...
@@ -91,20 +91,20 @@ VCL_Refresh(struct vcl **vcc)
}
void
VCL_Recache
(
struct
worker
*
wrk
,
struct
vcl
**
vclp
)
VCL_Recache
(
const
struct
worker
*
wrk
,
struct
vcl
**
vclp
)
{
AN
(
wrk
);
AN
(
vclp
);
CHECK_OBJ_NOTNULL
(
*
vclp
,
VCL_MAGIC
);
if
(
*
vclp
!=
vcl_active
||
wrk
->
vcl
==
vcl_active
)
{
if
(
*
vclp
!=
vcl_active
||
wrk
->
wpriv
->
vcl
==
vcl_active
)
{
VCL_Rel
(
vclp
);
return
;
}
if
(
wrk
->
vcl
!=
NULL
)
VCL_Rel
(
&
wrk
->
vcl
);
wrk
->
vcl
=
*
vclp
;
if
(
wrk
->
wpriv
->
vcl
!=
NULL
)
VCL_Rel
(
&
wrk
->
wpriv
->
vcl
);
wrk
->
wpriv
->
vcl
=
*
vclp
;
*
vclp
=
NULL
;
}
...
...
bin/varnishd/cache/cache_wrk.c
View file @
9ed99f61
...
...
@@ -155,8 +155,8 @@ WRK_Thread(struct pool *qp, size_t stacksize, unsigned thread_workspace)
AZ
(
w
->
pool
);
VSL
(
SLT_WorkThread
,
0
,
"%p end"
,
w
);
if
(
w
->
vcl
!=
NULL
)
VCL_Rel
(
&
w
->
vcl
);
if
(
w
->
wpriv
->
vcl
!=
NULL
)
VCL_Rel
(
&
w
->
wpriv
->
vcl
);
AZ
(
pthread_cond_destroy
(
&
w
->
cond
));
HSH_Cleanup
(
w
);
Pool_Sumstat
(
w
);
...
...
@@ -433,7 +433,7 @@ Pool_Work_Thread(struct pool *pp, struct worker *wrk)
* so that we'll wake up and get a
* chance to push stats. */
tmo
=
now
+
1
.;
else
if
(
wrk
->
vcl
==
NULL
)
else
if
(
wrk
->
wpriv
->
vcl
==
NULL
)
tmo
=
0
;
else
if
(
DO_DEBUG
(
DBG_VTC_MODE
))
tmo
=
now
+
1
.;
...
...
@@ -468,8 +468,8 @@ Pool_Work_Thread(struct pool *pp, struct worker *wrk)
// Presumably ETIMEDOUT but we do not
// assert this because pthread condvars
// are not airtight.
if
(
wrk
->
vcl
)
VCL_Rel
(
&
wrk
->
vcl
);
if
(
wrk
->
wpriv
->
vcl
)
VCL_Rel
(
&
wrk
->
wpriv
->
vcl
);
now
=
VTIM_real
();
}
}
while
(
tp
==
NULL
);
...
...
@@ -483,8 +483,8 @@ Pool_Work_Thread(struct pool *pp, struct worker *wrk)
memset
(
wrk
->
task
,
0
,
sizeof
wrk
->
task
);
assert
(
wrk
->
pool
==
pp
);
tp
->
func
(
wrk
,
tp
->
priv
);
if
(
DO_DEBUG
(
DBG_VCLREL
)
&&
wrk
->
vcl
!=
NULL
)
VCL_Rel
(
&
wrk
->
vcl
);
if
(
DO_DEBUG
(
DBG_VCLREL
)
&&
wrk
->
wpriv
->
vcl
!=
NULL
)
VCL_Rel
(
&
wrk
->
wpriv
->
vcl
);
tpx
=
*
wrk
->
task
;
tp
=
&
tpx
;
}
while
(
tp
->
func
!=
NULL
);
...
...
bin/varnishd/http2/cache_http2_session.c
View file @
9ed99f61
...
...
@@ -347,8 +347,8 @@ h2_new_session(struct worker *wrk, void *arg)
sp
=
req
->
sp
;
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
if
(
wrk
->
vcl
)
VCL_Rel
(
&
wrk
->
vcl
);
if
(
wrk
->
wpriv
->
vcl
)
VCL_Rel
(
&
wrk
->
wpriv
->
vcl
);
assert
(
req
->
transport
==
&
H2_transport
);
...
...
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