Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
unique-xids
Commits
a1cdab13
Commit
a1cdab13
authored
Feb 19, 2012
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove struct sess entirely from bgthreads
parent
e6327393
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
24 deletions
+18
-24
cache.h
bin/varnishd/cache/cache.h
+1
-1
cache_ban.c
bin/varnishd/cache/cache_ban.c
+4
-4
cache_expire.c
bin/varnishd/cache/cache_expire.c
+7
-7
cache_wrk.c
bin/varnishd/cache/cache_wrk.c
+1
-5
hash_critbit.c
bin/varnishd/hash/hash_critbit.c
+1
-2
storage_persistent.c
bin/varnishd/storage/storage_persistent.c
+4
-5
No files found.
bin/varnishd/cache/cache.h
View file @
a1cdab13
...
...
@@ -981,7 +981,7 @@ void WRK_Init(void);
int
WRK_TrySumStat
(
struct
worker
*
w
);
void
WRK_SumStat
(
struct
worker
*
w
);
void
*
WRK_thread
(
void
*
priv
);
typedef
void
*
bgthread_t
(
struct
sess
*
,
void
*
priv
);
typedef
void
*
bgthread_t
(
struct
worker
*
,
void
*
priv
);
void
WRK_BgThread
(
pthread_t
*
thr
,
const
char
*
name
,
bgthread_t
*
func
,
void
*
priv
);
...
...
bin/varnishd/cache/cache_ban.c
View file @
a1cdab13
...
...
@@ -927,7 +927,7 @@ ban_lurker_work(struct worker *wrk, unsigned pass)
}
static
void
*
__match_proto__
(
bgthread_t
)
ban_lurker
(
struct
sess
*
sp
,
void
*
priv
)
ban_lurker
(
struct
worker
*
wrk
,
void
*
priv
)
{
struct
ban
*
bf
;
unsigned
pass
=
(
1
<<
LURK_SHIFT
);
...
...
@@ -950,9 +950,9 @@ ban_lurker(struct sess *sp, void *priv)
VTIM_sleep
(
1
.
0
);
}
i
=
ban_lurker_work
(
sp
->
wrk
,
pass
);
VSL_Flush
(
sp
->
wrk
->
vsl
,
0
);
WRK_SumStat
(
sp
->
wrk
);
i
=
ban_lurker_work
(
wrk
,
pass
);
VSL_Flush
(
wrk
->
vsl
,
0
);
WRK_SumStat
(
wrk
);
if
(
i
)
{
pass
+=
(
1
<<
LURK_SHIFT
);
pass
&=
BAN_F_LURK
;
...
...
bin/varnishd/cache/cache_expire.c
View file @
a1cdab13
...
...
@@ -330,7 +330,7 @@ EXP_Rearm(const struct object *o)
*/
static
void
*
__match_proto__
(
bgthread_t
)
exp_timer
(
struct
sess
*
sp
,
void
*
priv
)
exp_timer
(
struct
worker
*
wrk
,
void
*
priv
)
{
struct
objcore
*
oc
;
struct
lru
*
lru
;
...
...
@@ -342,8 +342,8 @@ exp_timer(struct sess *sp, void *priv)
oc
=
NULL
;
while
(
1
)
{
if
(
oc
==
NULL
)
{
VSL_Flush
(
sp
->
wrk
->
vsl
,
0
);
WRK_SumStat
(
sp
->
wrk
);
VSL_Flush
(
wrk
->
vsl
,
0
);
WRK_SumStat
(
wrk
);
VTIM_sleep
(
cache_param
->
expiry_sleep
);
t
=
VTIM_real
();
}
...
...
@@ -399,10 +399,10 @@ exp_timer(struct sess *sp, void *priv)
VSC_C_main
->
n_expired
++
;
CHECK_OBJ_NOTNULL
(
oc
->
objhead
,
OBJHEAD_MAGIC
);
o
=
oc_getobj
(
&
sp
->
wrk
->
stats
,
oc
);
WSL
(
sp
->
wrk
->
vsl
,
SLT_ExpKill
,
0
,
"%u %.0f"
,
oc_getxid
(
&
sp
->
wrk
->
stats
,
oc
),
EXP_Ttl
(
NULL
,
o
)
-
t
);
(
void
)
HSH_Deref
(
&
sp
->
wrk
->
stats
,
oc
,
NULL
);
o
=
oc_getobj
(
&
wrk
->
stats
,
oc
);
WSL
(
wrk
->
vsl
,
SLT_ExpKill
,
0
,
"%u %.0f"
,
oc_getxid
(
&
wrk
->
stats
,
oc
),
EXP_Ttl
(
NULL
,
o
)
-
t
);
(
void
)
HSH_Deref
(
&
wrk
->
stats
,
oc
,
NULL
);
}
NEEDLESS_RETURN
(
NULL
);
}
...
...
bin/varnishd/cache/cache_wrk.c
View file @
a1cdab13
...
...
@@ -94,19 +94,15 @@ wrk_bgthread(void *arg)
{
struct
bgthread
*
bt
;
struct
worker
wrk
;
struct
sess
*
sp
;
uint32_t
logbuf
[
1024
];
/* XXX: size ? */
CAST_OBJ_NOTNULL
(
bt
,
arg
,
BGTHREAD_MAGIC
);
THR_SetName
(
bt
->
name
);
sp
=
SES_Alloc
();
XXXAN
(
sp
);
memset
(
&
wrk
,
0
,
sizeof
wrk
);
sp
->
wrk
=
&
wrk
;
wrk
.
magic
=
WORKER_MAGIC
;
VSL_Setup
(
wrk
.
vsl
,
logbuf
,
sizeof
logbuf
);
(
void
)
bt
->
func
(
sp
,
bt
->
priv
);
(
void
)
bt
->
func
(
&
wrk
,
bt
->
priv
);
WRONG
(
"BgThread terminated"
);
...
...
bin/varnishd/hash/hash_critbit.c
View file @
a1cdab13
...
...
@@ -345,10 +345,9 @@ static struct cli_proto hcb_cmds[] = {
/*--------------------------------------------------------------------*/
static
void
*
__match_proto__
(
bgthread_t
)
hcb_cleaner
(
struct
sess
*
sp
,
void
*
priv
)
hcb_cleaner
(
struct
worker
*
wrk
,
void
*
priv
)
{
struct
hcb_y
*
y
,
*
y2
;
struct
worker
*
wrk
=
sp
->
wrk
;
struct
objhead
*
oh
,
*
oh2
;
(
void
)
priv
;
...
...
bin/varnishd/storage/storage_persistent.c
View file @
a1cdab13
...
...
@@ -268,18 +268,18 @@ smp_open_segs(struct smp_sc *sc, struct smp_signctx *ctx)
*/
static
void
*
__match_proto__
(
bgthread_t
)
smp_thread
(
struct
sess
*
sp
,
void
*
priv
)
smp_thread
(
struct
worker
*
wrk
,
void
*
priv
)
{
struct
smp_sc
*
sc
;
struct
smp_seg
*
sg
;
CHECK_OBJ_NOTNULL
(
sp
,
SESS
_MAGIC
);
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER
_MAGIC
);
CAST_OBJ_NOTNULL
(
sc
,
priv
,
SMP_SC_MAGIC
);
/* First, load all the objects from all segments */
VTAILQ_FOREACH
(
sg
,
&
sc
->
segments
,
list
)
if
(
sg
->
flags
&
SMP_SEG_MUSTLOAD
)
smp_load_seg
(
sp
->
wrk
,
sc
,
sg
);
smp_load_seg
(
wrk
,
sc
,
sg
);
sc
->
flags
|=
SMP_SC_LOADED
;
BAN_TailDeref
(
&
sc
->
tailban
);
...
...
@@ -288,8 +288,7 @@ smp_thread(struct sess *sp, void *priv)
while
(
1
)
{
(
void
)
sleep
(
1
);
sg
=
VTAILQ_FIRST
(
&
sc
->
segments
);
if
(
sg
!=
NULL
&&
sg
->
sc
->
cur_seg
&&
sg
->
nobj
==
0
)
{
if
(
sg
!=
NULL
&&
sg
->
sc
->
cur_seg
&&
sg
->
nobj
==
0
)
{
Lck_Lock
(
&
sc
->
mtx
);
smp_save_segs
(
sc
);
Lck_Unlock
(
&
sc
->
mtx
);
...
...
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