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
421ebab3
Commit
421ebab3
authored
Sep 11, 2017
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move the sigaltstack init to a generic THR_Init() and use it for all threads
parent
35ffe6a6
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
27 additions
and
8 deletions
+27
-8
cache_acceptor.c
bin/varnishd/cache/cache_acceptor.c
+1
-0
cache_main.c
bin/varnishd/cache/cache_main.c
+16
-0
cache_mempool.c
bin/varnishd/cache/cache_mempool.c
+1
-0
cache_pool.c
bin/varnishd/cache/cache_pool.c
+1
-0
cache_priv.h
bin/varnishd/cache/cache_priv.h
+1
-0
cache_wrk.c
bin/varnishd/cache/cache_wrk.c
+3
-8
cache_waiter_epoll.c
bin/varnishd/waiter/cache_waiter_epoll.c
+1
-0
cache_waiter_kqueue.c
bin/varnishd/waiter/cache_waiter_kqueue.c
+1
-0
cache_waiter_poll.c
bin/varnishd/waiter/cache_waiter_poll.c
+1
-0
cache_waiter_ports.c
bin/varnishd/waiter/cache_waiter_ports.c
+1
-0
No files found.
bin/varnishd/cache/cache_acceptor.c
View file @
421ebab3
...
...
@@ -524,6 +524,7 @@ vca_acct(void *arg)
double
t0
,
now
;
THR_SetName
(
"cache-acceptor"
);
THR_Init
();
(
void
)
arg
;
(
void
)
vca_tcp_opt_init
();
...
...
bin/varnishd/cache/cache_main.c
View file @
421ebab3
...
...
@@ -112,6 +112,22 @@ THR_GetName(void)
return
(
pthread_getspecific
(
name_key
));
}
/*--------------------------------------------------------------------
* Generic setup all our threads should call
*/
#ifdef HAVE_SIGALTSTACK
#include <signal.h>
extern
stack_t
altstack
;
#endif
void
THR_Init
(
void
)
{
#ifdef HAVE_SIGALTSTACK
AZ
(
sigaltstack
(
&
altstack
,
NULL
));
#endif
}
/*--------------------------------------------------------------------
* VXID's are unique transaction numbers allocated with a minimum of
* locking overhead via pools in the worker threads.
...
...
bin/varnishd/cache/cache_mempool.c
View file @
421ebab3
...
...
@@ -104,6 +104,7 @@ mpl_guard(void *priv)
CAST_OBJ_NOTNULL
(
mpl
,
priv
,
MEMPOOL_MAGIC
);
THR_SetName
(
mpl
->
name
);
THR_Init
();
mpl_slp
=
0
.
15
;
// random
while
(
1
)
{
VTIM_sleep
(
mpl_slp
);
...
...
bin/varnishd/cache/cache_pool.c
View file @
421ebab3
...
...
@@ -187,6 +187,7 @@ pool_poolherder(void *priv)
void
*
rvp
;
THR_SetName
(
"pool_poolherder"
);
THR_Init
();
(
void
)
priv
;
nwq
=
0
;
...
...
bin/varnishd/cache/cache_priv.h
View file @
421ebab3
...
...
@@ -88,6 +88,7 @@ void THR_SetBusyobj(const struct busyobj *);
struct
busyobj
*
THR_GetBusyobj
(
void
);
void
THR_SetRequest
(
const
struct
req
*
);
struct
req
*
THR_GetRequest
(
void
);
void
THR_Init
(
void
);
/* cache_lck.c */
void
LCK_Init
(
void
);
...
...
bin/varnishd/cache/cache_wrk.c
View file @
421ebab3
...
...
@@ -41,11 +41,6 @@
#include "hash/hash_slinger.h"
#ifdef HAVE_SIGALTSTACK
#include <signal.h>
extern
stack_t
altstack
;
#endif
static
void
Pool_Work_Thread
(
struct
pool
*
pp
,
struct
worker
*
wrk
);
/*--------------------------------------------------------------------
...
...
@@ -70,6 +65,7 @@ wrk_bgthread(void *arg)
CAST_OBJ_NOTNULL
(
bt
,
arg
,
BGTHREAD_MAGIC
);
THR_SetName
(
bt
->
name
);
THR_Init
();
INIT_OBJ
(
&
wrk
,
WORKER_MAGIC
);
memset
(
&
ds
,
0
,
sizeof
ds
);
wrk
.
stats
=
&
ds
;
...
...
@@ -406,9 +402,7 @@ pool_thread(void *priv)
struct
pool_info
*
pi
;
CAST_OBJ_NOTNULL
(
pi
,
priv
,
POOL_INFO_MAGIC
);
#ifdef HAVE_SIGALTSTACK
AZ
(
sigaltstack
(
&
altstack
,
NULL
));
#endif
THR_Init
();
WRK_Thread
(
pi
->
qp
,
pi
->
stacksize
,
cache_param
->
workspace_thread
);
FREE_OBJ
(
pi
);
return
(
NULL
);
...
...
@@ -483,6 +477,7 @@ pool_herder(void *priv)
CAST_OBJ_NOTNULL
(
pp
,
priv
,
POOL_MAGIC
);
THR_SetName
(
"pool_herder"
);
THR_Init
();
while
(
!
pp
->
die
||
pp
->
nthr
>
0
)
{
wthread_min
=
cache_param
->
wthread_min
;
...
...
bin/varnishd/waiter/cache_waiter_epoll.c
View file @
421ebab3
...
...
@@ -80,6 +80,7 @@ vwe_thread(void *priv)
w
=
vwe
->
waiter
;
CHECK_OBJ_NOTNULL
(
w
,
WAITER_MAGIC
);
THR_SetName
(
"cache-epoll"
);
THR_Init
();
now
=
VTIM_real
();
while
(
1
)
{
...
...
bin/varnishd/waiter/cache_waiter_kqueue.c
View file @
421ebab3
...
...
@@ -75,6 +75,7 @@ vwk_thread(void *priv)
w
=
vwk
->
waiter
;
CHECK_OBJ_NOTNULL
(
w
,
WAITER_MAGIC
);
THR_SetName
(
"cache-kqueue"
);
THR_Init
();
now
=
VTIM_real
();
while
(
1
)
{
...
...
bin/varnishd/waiter/cache_waiter_poll.c
View file @
421ebab3
...
...
@@ -161,6 +161,7 @@ vwp_main(void *priv)
int
i
;
THR_SetName
(
"cache-poll"
);
THR_Init
();
CAST_OBJ_NOTNULL
(
vwp
,
priv
,
VWP_MAGIC
);
w
=
vwp
->
waiter
;
...
...
bin/varnishd/waiter/cache_waiter_ports.c
View file @
421ebab3
...
...
@@ -152,6 +152,7 @@ vws_thread(void *priv)
w
=
vws
->
waiter
;
CHECK_OBJ_NOTNULL
(
w
,
WAITER_MAGIC
);
THR_SetName
(
"cache-ports"
);
THR_Init
();
now
=
VTIM_real
();
...
...
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