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
738cafa0
Commit
738cafa0
authored
Sep 17, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop struct workreq, we don't use it.
parent
12f5366e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
52 deletions
+20
-52
cache.h
bin/varnishd/cache.h
+2
-18
cache_cli.c
bin/varnishd/cache_cli.c
+0
-1
cache_pool.c
bin/varnishd/cache_pool.c
+18
-33
No files found.
bin/varnishd/cache.h
View file @
738cafa0
...
...
@@ -108,7 +108,6 @@ struct objhead;
struct
objcore
;
struct
busyobj
;
struct
storage
;
struct
workreq
;
struct
vrt_backend
;
struct
cli_proto
;
struct
ban
;
...
...
@@ -307,7 +306,7 @@ struct worker {
pthread_cond_t
cond
;
VTAILQ_ENTRY
(
worker
)
list
;
struct
workreq
*
wrq
;
struct
sess
*
sp
;
struct
VCL_conf
*
vcl
;
...
...
@@ -369,21 +368,6 @@ struct worker {
struct
acct
acct_tmp
;
};
/* Work Request for worker thread ------------------------------------*/
/*
* This is a worker-function.
* XXX: typesafety is probably not worth fighting for
*/
typedef
void
workfunc
(
struct
worker
*
,
void
*
priv
);
struct
workreq
{
VTAILQ_ENTRY
(
workreq
)
list
;
workfunc
*
func
;
void
*
priv
;
};
/* Storage -----------------------------------------------------------*/
struct
storage
{
...
...
@@ -614,7 +598,7 @@ struct sess {
/* Various internal stuff */
struct
sessmem
*
mem
;
struct
workreq
workreq
;
VTAILQ_ENTRY
(
sess
)
poollist
;
struct
acct
acct_req
;
struct
acct
acct_ses
;
...
...
bin/varnishd/cache_cli.c
View file @
738cafa0
...
...
@@ -131,7 +131,6 @@ cli_debug_sizeof(struct cli *cli, const char * const *av, void *priv)
SZOF
(
struct
http_conn
);
SZOF
(
struct
acct
);
SZOF
(
struct
worker
);
SZOF
(
struct
workreq
);
SZOF
(
struct
storage
);
SZOF
(
struct
object
);
SZOF
(
struct
objcore
);
...
...
bin/varnishd/cache_pool.c
View file @
738cafa0
...
...
@@ -69,7 +69,7 @@ struct pool {
#define POOL_MAGIC 0x606658fa
struct
lock
mtx
;
struct
workerhead
idle
;
VTAILQ_HEAD
(,
workreq
)
queue
;
VTAILQ_HEAD
(,
sess
)
queue
;
unsigned
nthr
;
unsigned
lqueue
;
unsigned
last_lqueue
;
...
...
@@ -105,9 +105,9 @@ Pool_Work_Thread(void *priv, struct worker *w)
CHECK_OBJ_NOTNULL
(
w
,
WORKER_MAGIC
);
/* Process queued requests, if any */
w
->
wrq
=
VTAILQ_FIRST
(
&
qp
->
queue
);
if
(
w
->
wrq
!=
NULL
)
{
VTAILQ_REMOVE
(
&
qp
->
queue
,
w
->
wrq
,
list
);
w
->
sp
=
VTAILQ_FIRST
(
&
qp
->
queue
);
if
(
w
->
sp
!=
NULL
)
{
VTAILQ_REMOVE
(
&
qp
->
queue
,
w
->
sp
,
pool
list
);
qp
->
lqueue
--
;
}
else
{
if
(
isnan
(
w
->
lastused
))
...
...
@@ -117,17 +117,21 @@ Pool_Work_Thread(void *priv, struct worker *w)
WRK_SumStat
(
w
);
Lck_CondWait
(
&
w
->
cond
,
&
qp
->
mtx
);
}
if
(
w
->
wrq
==
NULL
)
if
(
w
->
sp
==
NULL
)
break
;
Lck_Unlock
(
&
qp
->
mtx
);
stats_clean
=
0
;
AN
(
w
->
wrq
);
AN
(
w
->
wrq
->
func
);
w
->
lastused
=
NAN
;
WS_Reset
(
w
->
ws
,
NULL
);
w
->
storage_hint
=
NULL
;
w
->
wrq
->
func
(
w
,
w
->
wrq
->
priv
);
AZ
(
w
->
sp
->
wrk
);
THR_SetSession
(
w
->
sp
);
w
->
sp
->
wrk
=
w
;
CHECK_OBJ_ORNULL
(
w
->
nobjhead
,
OBJHEAD_MAGIC
);
CNT_Session
(
w
->
sp
);
CHECK_OBJ_ORNULL
(
w
->
nobjhead
,
OBJHEAD_MAGIC
);
THR_SetSession
(
NULL
);
WS_Assert
(
w
->
ws
);
AZ
(
w
->
bereq
->
ws
);
...
...
@@ -136,7 +140,7 @@ Pool_Work_Thread(void *priv, struct worker *w)
AZ
(
w
->
wrw
.
wfd
);
AZ
(
w
->
storage_hint
);
assert
(
w
->
wlp
==
w
->
wlb
);
w
->
wrq
=
NULL
;
w
->
sp
=
NULL
;
if
(
params
->
diag_bitmap
&
0x00040000
)
{
if
(
w
->
vcl
!=
NULL
)
VCL_Rel
(
&
w
->
vcl
);
...
...
@@ -156,7 +160,7 @@ Pool_Work_Thread(void *priv, struct worker *w)
*/
static
int
WRK_Queue
(
struct
workreq
*
wrq
)
WRK_Queue
(
struct
sess
*
sp
)
{
struct
worker
*
w
;
struct
pool
*
qp
;
...
...
@@ -181,7 +185,7 @@ WRK_Queue(struct workreq *wrq)
if
(
w
!=
NULL
)
{
VTAILQ_REMOVE
(
&
qp
->
idle
,
w
,
list
);
Lck_Unlock
(
&
qp
->
mtx
);
w
->
wrq
=
wrq
;
w
->
sp
=
sp
;
AZ
(
pthread_cond_signal
(
&
w
->
cond
));
return
(
0
);
}
...
...
@@ -193,7 +197,7 @@ WRK_Queue(struct workreq *wrq)
return
(
-
1
);
}
VTAILQ_INSERT_TAIL
(
&
qp
->
queue
,
wrq
,
list
);
VTAILQ_INSERT_TAIL
(
&
qp
->
queue
,
sp
,
pool
list
);
qp
->
nqueue
++
;
qp
->
lqueue
++
;
Lck_Unlock
(
&
qp
->
mtx
);
...
...
@@ -203,31 +207,12 @@ WRK_Queue(struct workreq *wrq)
/*--------------------------------------------------------------------*/
static
void
wrk_do_cnt_sess
(
struct
worker
*
w
,
void
*
priv
)
{
struct
sess
*
sess
;
CAST_OBJ_NOTNULL
(
sess
,
priv
,
SESS_MAGIC
);
AZ
(
sess
->
wrk
);
THR_SetSession
(
sess
);
sess
->
wrk
=
w
;
CHECK_OBJ_ORNULL
(
w
->
nobjhead
,
OBJHEAD_MAGIC
);
CNT_Session
(
sess
);
CHECK_OBJ_ORNULL
(
w
->
nobjhead
,
OBJHEAD_MAGIC
);
THR_SetSession
(
NULL
);
}
/*--------------------------------------------------------------------*/
int
Pool_QueueSession
(
struct
sess
*
sp
)
{
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
AZ
(
sp
->
wrk
);
sp
->
workreq
.
func
=
wrk_do_cnt_sess
;
sp
->
workreq
.
priv
=
sp
;
if
(
WRK_Queue
(
&
sp
->
workreq
)
==
0
)
if
(
WRK_Queue
(
sp
)
==
0
)
return
(
0
);
/*
...
...
@@ -303,7 +288,7 @@ wrk_decimate_flock(struct pool *qp, double t_idle, struct VSC_C_main *vs)
/* And give it a kiss on the cheek... */
if
(
w
!=
NULL
)
{
AZ
(
w
->
wrq
);
AZ
(
w
->
sp
);
AZ
(
pthread_cond_signal
(
&
w
->
cond
));
TIM_sleep
(
params
->
wthread_purge_delay
*
1e-3
);
}
...
...
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