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
56234c12
Commit
56234c12
authored
Nov 11, 2013
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move the EXP_Touch() logic into EXP_Touch().
parent
7dd89f87
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
13 deletions
+15
-13
cache.h
bin/varnishd/cache/cache.h
+1
-1
cache_expire.c
bin/varnishd/cache/cache_expire.c
+12
-6
cache_req_fsm.c
bin/varnishd/cache/cache_req_fsm.c
+2
-6
No files found.
bin/varnishd/cache/cache.h
View file @
56234c12
...
...
@@ -915,7 +915,7 @@ void EXP_Inject(struct objcore *oc, struct lru *lru, double when);
void
EXP_Init
(
void
);
void
EXP_Rearm
(
struct
object
*
o
,
double
now
,
double
ttl
,
double
grace
,
double
keep
);
int
EXP_Touch
(
struct
objcore
*
oc
);
void
EXP_Touch
(
struct
objcore
*
oc
,
double
now
);
int
EXP_NukeOne
(
struct
busyobj
*
,
struct
lru
*
lru
);
void
EXP_NukeLRU
(
struct
worker
*
wrk
,
struct
vsl_log
*
vsl
,
struct
lru
*
lru
);
...
...
bin/varnishd/cache/cache_expire.c
View file @
56234c12
...
...
@@ -177,13 +177,19 @@ EXP_Insert(struct objcore *oc)
* This optimization obviously leaves the LRU list imperfectly sorted.
*/
int
EXP_Touch
(
struct
objcore
*
oc
)
void
EXP_Touch
(
struct
objcore
*
oc
,
double
now
)
{
struct
lru
*
lru
;
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
if
(
oc
->
busyobj
!=
NULL
)
return
;
if
(
now
-
oc
->
last_lru
<
cache_param
->
lru_timeout
)
return
;
lru
=
oc_getlru
(
oc
);
CHECK_OBJ_NOTNULL
(
lru
,
LRU_MAGIC
);
...
...
@@ -192,21 +198,21 @@ EXP_Touch(struct objcore *oc)
* objects on the lru list, since LRU doesn't really help much.
*/
if
(
lru
->
flags
&
LRU_F_DONTMOVE
)
return
(
0
)
;
return
;
if
(
Lck_Trylock
(
&
lru
->
mtx
))
return
(
0
)
;
return
;
AN
(
oc
->
flags
&
OC_F_EXP
);
if
(
!
(
oc
->
flags
&
OC_F_OFFLRU
))
{
/* Can only it while it's actually on the LRU list */
/* Can only
touch
it while it's actually on the LRU list */
VTAILQ_REMOVE
(
&
lru
->
lru_head
,
oc
,
lru_list
);
VTAILQ_INSERT_TAIL
(
&
lru
->
lru_head
,
oc
,
lru_list
);
VSC_C_main
->
n_lru_moved
++
;
}
oc
->
last_lru
=
now
;
Lck_Unlock
(
&
lru
->
mtx
);
return
(
1
);
}
/*--------------------------------------------------------------------
...
...
bin/varnishd/cache/cache_req_fsm.c
View file @
56234c12
...
...
@@ -104,12 +104,8 @@ cnt_deliver(struct worker *wrk, struct req *req)
assert
(
req
->
obj
->
objcore
->
refcnt
>
0
);
req
->
t_resp
=
W_TIM_real
(
wrk
);
if
(
!
(
req
->
obj
->
objcore
->
flags
&
OC_F_PRIVATE
))
{
if
(
req
->
obj
->
objcore
->
busyobj
==
NULL
&&
(
req
->
t_resp
-
req
->
obj
->
objcore
->
last_lru
)
>
cache_param
->
lru_timeout
&&
EXP_Touch
(
req
->
obj
->
objcore
))
req
->
obj
->
objcore
->
last_lru
=
req
->
t_resp
;
}
if
(
!
(
req
->
obj
->
objcore
->
flags
&
OC_F_PRIVATE
))
EXP_Touch
(
req
->
obj
->
objcore
,
req
->
t_resp
);
HTTP_Setup
(
req
->
resp
,
req
->
ws
,
req
->
vsl
,
HTTP_Resp
);
...
...
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