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
fd83702a
Commit
fd83702a
authored
Feb 03, 2016
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a "posted" flag to keep track of oc's already mailed to exp
parent
9c2f8677
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
cache.h
bin/varnishd/cache/cache.h
+1
-0
cache_expire.c
bin/varnishd/cache/cache_expire.c
+13
-14
No files found.
bin/varnishd/cache/cache.h
View file @
fd83702a
...
...
@@ -430,6 +430,7 @@ struct objcore {
#define OC_F_DYING (1<<7)
uint8_t
exp_flags
;
#define OC_EF_POSTED (1<<1)
#define OC_EF_MOVE (1<<2)
#define OC_EF_INSERT (1<<3)
#define OC_EF_EXP (1<<4)
...
...
bin/varnishd/cache/cache_expire.c
View file @
fd83702a
...
...
@@ -143,11 +143,13 @@ exp_mail_it(struct objcore *oc, uint8_t cmds)
AN
(
isnan
(
oc
->
last_lru
));
Lck_Lock
(
&
exphdl
->
mtx
);
oc
->
exp_flags
|=
cmds
;
if
(
oc
->
flags
&
OC_F_DYING
)
VSTAILQ_INSERT_HEAD
(
&
exphdl
->
inbox
,
oc
,
exp_list
);
else
VSTAILQ_INSERT_TAIL
(
&
exphdl
->
inbox
,
oc
,
exp_list
);
if
(
!
(
oc
->
exp_flags
&
OC_EF_POSTED
))
{
if
(
oc
->
flags
&
OC_F_DYING
)
VSTAILQ_INSERT_HEAD
(
&
exphdl
->
inbox
,
oc
,
exp_list
);
else
VSTAILQ_INSERT_TAIL
(
&
exphdl
->
inbox
,
oc
,
exp_list
);
}
oc
->
exp_flags
|=
cmds
|
OC_EF_POSTED
;
VSC_C_main
->
exp_mailed
++
;
AZ
(
pthread_cond_signal
(
&
exphdl
->
condvar
));
Lck_Unlock
(
&
exphdl
->
mtx
);
...
...
@@ -355,9 +357,8 @@ EXP_Deregister_Callback(uintptr_t *handle)
*/
static
void
exp_inbox
(
struct
exp_priv
*
ep
,
struct
objcore
*
oc
,
double
now
)
exp_inbox
(
struct
exp_priv
*
ep
,
struct
objcore
*
oc
,
double
now
,
unsigned
flags
)
{
unsigned
flags
;
struct
lru
*
lru
;
CHECK_OBJ_NOTNULL
(
ep
,
EXP_PRIV_MAGIC
);
...
...
@@ -369,12 +370,6 @@ exp_inbox(struct exp_priv *ep, struct objcore *oc, double now)
lru
=
ObjGetLRU
(
oc
);
CHECK_OBJ_NOTNULL
(
lru
,
LRU_MAGIC
);
/* Evacuate our action-flags, and put it back on the LRU list */
Lck_Lock
(
&
ep
->
mtx
);
flags
=
oc
->
exp_flags
;
oc
->
exp_flags
&=
~
(
OC_EF_INSERT
|
OC_EF_MOVE
);
Lck_Unlock
(
&
ep
->
mtx
);
Lck_Lock
(
&
lru
->
mtx
);
AN
(
isnan
(
oc
->
last_lru
));
oc
->
last_lru
=
now
;
...
...
@@ -512,6 +507,7 @@ exp_thread(struct worker *wrk, void *priv)
struct
objcore
*
oc
;
double
t
=
0
,
tnext
=
0
;
struct
exp_priv
*
ep
;
unsigned
flags
=
0
;
CAST_OBJ_NOTNULL
(
ep
,
priv
,
EXP_PRIV_MAGIC
);
ep
->
wrk
=
wrk
;
...
...
@@ -526,6 +522,9 @@ exp_thread(struct worker *wrk, void *priv)
VSTAILQ_REMOVE
(
&
ep
->
inbox
,
oc
,
objcore
,
exp_list
);
VSC_C_main
->
exp_received
++
;
tnext
=
0
;
flags
=
oc
->
exp_flags
;
oc
->
exp_flags
&=
~
(
OC_EF_INSERT
|
OC_EF_MOVE
|
OC_EF_POSTED
);
}
else
if
(
tnext
>
t
)
{
VSL_Flush
(
&
ep
->
vsl
,
0
);
Pool_Sumstat
(
wrk
);
...
...
@@ -536,7 +535,7 @@ exp_thread(struct worker *wrk, void *priv)
t
=
VTIM_real
();
if
(
oc
!=
NULL
)
exp_inbox
(
ep
,
oc
,
t
);
exp_inbox
(
ep
,
oc
,
t
,
flags
);
else
tnext
=
exp_expire
(
ep
,
t
);
}
...
...
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