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
8332ca86
Commit
8332ca86
authored
Sep 17, 2011
by
Poul-Henning Kamp
Committed by
Tollef Fog Heen
Mar 09, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop struct workreq, we don't use it.
parent
654a81d5
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 @
8332ca86
...
...
@@ -108,7 +108,6 @@ struct objhead;
struct
objcore
;
struct
busyobj
;
struct
storage
;
struct
workreq
;
struct
vrt_backend
;
struct
cli_proto
;
struct
ban
;
...
...
@@ -304,7 +303,7 @@ struct worker {
pthread_cond_t
cond
;
VTAILQ_ENTRY
(
worker
)
list
;
struct
workreq
*
wrq
;
struct
sess
*
sp
;
struct
VCL_conf
*
vcl
;
...
...
@@ -367,21 +366,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
{
...
...
@@ -613,7 +597,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 @
8332ca86
...
...
@@ -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 @
8332ca86
...
...
@@ -67,7 +67,7 @@ struct wq {
#define WQ_MAGIC 0x606658fa
struct
lock
mtx
;
struct
workerhead
idle
;
VTAILQ_HEAD
(,
workreq
)
queue
;
VTAILQ_HEAD
(,
sess
)
queue
;
unsigned
nthr
;
unsigned
lqueue
;
unsigned
last_lqueue
;
...
...
@@ -159,9 +159,9 @@ wrk_thread_real(struct wq *qp, unsigned shm_workspace, unsigned sess_workspace,
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
))
...
...
@@ -171,17 +171,21 @@ wrk_thread_real(struct wq *qp, unsigned shm_workspace, unsigned sess_workspace,
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
);
...
...
@@ -190,7 +194,7 @@ wrk_thread_real(struct wq *qp, unsigned shm_workspace, unsigned sess_workspace,
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
);
...
...
@@ -241,7 +245,7 @@ wrk_thread(void *priv)
*/
static
int
WRK_Queue
(
struct
workreq
*
wrq
)
WRK_Queue
(
struct
sess
*
sp
)
{
struct
worker
*
w
;
struct
wq
*
qp
;
...
...
@@ -266,7 +270,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
);
}
...
...
@@ -278,7 +282,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
);
...
...
@@ -288,31 +292,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
WRK_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
);
/*
...
...
@@ -389,7 +374,7 @@ wrk_decimate_flock(struct wq *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