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
fe8ec801
Commit
fe8ec801
authored
Feb 14, 2012
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Argument strength-reduction: from worker to dstats
parent
2d49712f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
22 deletions
+22
-22
cache_ban.c
bin/varnishd/cache/cache_ban.c
+1
-1
cache_center.c
bin/varnishd/cache/cache_center.c
+7
-7
cache_expire.c
bin/varnishd/cache/cache_expire.c
+2
-2
cache_hash.c
bin/varnishd/cache/cache_hash.c
+9
-9
hash_critbit.c
bin/varnishd/hash/hash_critbit.c
+1
-1
hash_slinger.h
bin/varnishd/hash/hash_slinger.h
+2
-2
No files found.
bin/varnishd/cache/cache_ban.c
View file @
fe8ec801
...
@@ -908,7 +908,7 @@ ban_lurker_work(const struct sess *sp, unsigned pass)
...
@@ -908,7 +908,7 @@ ban_lurker_work(const struct sess *sp, unsigned pass)
if
(
cache_param
->
diag_bitmap
&
0x80000
)
if
(
cache_param
->
diag_bitmap
&
0x80000
)
VSL
(
SLT_Debug
,
0
,
"lurker done: %p %u %u"
,
VSL
(
SLT_Debug
,
0
,
"lurker done: %p %u %u"
,
oc
,
oc
->
flags
&
OC_F_LURK
,
pass
);
oc
,
oc
->
flags
&
OC_F_LURK
,
pass
);
(
void
)
HSH_Deref
(
sp
->
wrk
,
NULL
,
&
o
);
(
void
)
HSH_Deref
(
&
sp
->
wrk
->
stats
,
NULL
,
&
o
);
VTIM_sleep
(
cache_param
->
ban_lurker_sleep
);
VTIM_sleep
(
cache_param
->
ban_lurker_sleep
);
}
}
Lck_AssertHeld
(
&
ban_mtx
);
Lck_AssertHeld
(
&
ban_mtx
);
...
...
bin/varnishd/cache/cache_center.c
View file @
fe8ec801
...
@@ -289,7 +289,7 @@ cnt_prepresp(struct sess *sp, struct worker *wrk, struct req *req)
...
@@ -289,7 +289,7 @@ cnt_prepresp(struct sess *sp, struct worker *wrk, struct req *req)
HSH_Drop
(
wrk
);
HSH_Drop
(
wrk
);
VBO_DerefBusyObj
(
wrk
,
&
wrk
->
busyobj
);
VBO_DerefBusyObj
(
wrk
,
&
wrk
->
busyobj
);
}
else
{
}
else
{
(
void
)
HSH_Deref
(
wrk
,
NULL
,
&
req
->
obj
);
(
void
)
HSH_Deref
(
&
wrk
->
stats
,
NULL
,
&
req
->
obj
);
}
}
AZ
(
req
->
obj
);
AZ
(
req
->
obj
);
req
->
restarts
++
;
req
->
restarts
++
;
...
@@ -338,7 +338,7 @@ cnt_deliver(struct sess *sp, struct worker *wrk, struct req *req)
...
@@ -338,7 +338,7 @@ cnt_deliver(struct sess *sp, struct worker *wrk, struct req *req)
RES_WriteObj
(
sp
);
RES_WriteObj
(
sp
);
assert
(
WRW_IsReleased
(
wrk
));
assert
(
WRW_IsReleased
(
wrk
));
(
void
)
HSH_Deref
(
wrk
,
NULL
,
&
req
->
obj
);
(
void
)
HSH_Deref
(
&
wrk
->
stats
,
NULL
,
&
req
->
obj
);
http_Teardown
(
req
->
resp
);
http_Teardown
(
req
->
resp
);
sp
->
step
=
STP_DONE
;
sp
->
step
=
STP_DONE
;
return
(
0
);
return
(
0
);
...
@@ -641,7 +641,7 @@ cnt_fetch(struct sess *sp, struct worker *wrk, struct req *req)
...
@@ -641,7 +641,7 @@ cnt_fetch(struct sess *sp, struct worker *wrk, struct req *req)
if
(
req
->
objcore
!=
NULL
)
{
if
(
req
->
objcore
!=
NULL
)
{
CHECK_OBJ_NOTNULL
(
req
->
objcore
,
OBJCORE_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
->
objcore
,
OBJCORE_MAGIC
);
AZ
(
HSH_Deref
(
wrk
,
req
->
objcore
,
NULL
));
AZ
(
HSH_Deref
(
&
wrk
->
stats
,
req
->
objcore
,
NULL
));
req
->
objcore
=
NULL
;
req
->
objcore
=
NULL
;
}
}
VBO_DerefBusyObj
(
wrk
,
&
wrk
->
busyobj
);
VBO_DerefBusyObj
(
wrk
,
&
wrk
->
busyobj
);
...
@@ -972,7 +972,7 @@ cnt_streambody(struct sess *sp, struct worker *wrk, struct req *req)
...
@@ -972,7 +972,7 @@ cnt_streambody(struct sess *sp, struct worker *wrk, struct req *req)
RES_StreamEnd
(
sp
);
RES_StreamEnd
(
sp
);
assert
(
WRW_IsReleased
(
wrk
));
assert
(
WRW_IsReleased
(
wrk
));
(
void
)
HSH_Deref
(
wrk
,
NULL
,
&
req
->
obj
);
(
void
)
HSH_Deref
(
&
wrk
->
stats
,
NULL
,
&
req
->
obj
);
VBO_DerefBusyObj
(
wrk
,
&
wrk
->
busyobj
);
VBO_DerefBusyObj
(
wrk
,
&
wrk
->
busyobj
);
http_Teardown
(
req
->
resp
);
http_Teardown
(
req
->
resp
);
sp
->
step
=
STP_DONE
;
sp
->
step
=
STP_DONE
;
...
@@ -1065,7 +1065,7 @@ cnt_hit(struct sess *sp, struct worker *wrk, struct req *req)
...
@@ -1065,7 +1065,7 @@ cnt_hit(struct sess *sp, struct worker *wrk, struct req *req)
}
}
/* Drop our object, we won't need it */
/* Drop our object, we won't need it */
(
void
)
HSH_Deref
(
wrk
,
NULL
,
&
req
->
obj
);
(
void
)
HSH_Deref
(
&
wrk
->
stats
,
NULL
,
&
req
->
obj
);
req
->
objcore
=
NULL
;
req
->
objcore
=
NULL
;
switch
(
req
->
handling
)
{
switch
(
req
->
handling
)
{
...
@@ -1183,7 +1183,7 @@ cnt_lookup(struct sess *sp, struct worker *wrk, struct req *req)
...
@@ -1183,7 +1183,7 @@ cnt_lookup(struct sess *sp, struct worker *wrk, struct req *req)
if
(
oc
->
flags
&
OC_F_PASS
)
{
if
(
oc
->
flags
&
OC_F_PASS
)
{
wrk
->
stats
.
cache_hitpass
++
;
wrk
->
stats
.
cache_hitpass
++
;
WSP
(
sp
,
SLT_HitPass
,
"%u"
,
req
->
obj
->
xid
);
WSP
(
sp
,
SLT_HitPass
,
"%u"
,
req
->
obj
->
xid
);
(
void
)
HSH_Deref
(
wrk
,
NULL
,
&
req
->
obj
);
(
void
)
HSH_Deref
(
&
wrk
->
stats
,
NULL
,
&
req
->
obj
);
AZ
(
req
->
objcore
);
AZ
(
req
->
objcore
);
sp
->
step
=
STP_PASS
;
sp
->
step
=
STP_PASS
;
return
(
0
);
return
(
0
);
...
@@ -1242,7 +1242,7 @@ cnt_miss(struct sess *sp, struct worker *wrk, struct req *req)
...
@@ -1242,7 +1242,7 @@ cnt_miss(struct sess *sp, struct worker *wrk, struct req *req)
return
(
0
);
return
(
0
);
}
}
AZ
(
HSH_Deref
(
wrk
,
req
->
objcore
,
NULL
));
AZ
(
HSH_Deref
(
&
wrk
->
stats
,
req
->
objcore
,
NULL
));
req
->
objcore
=
NULL
;
req
->
objcore
=
NULL
;
http_Teardown
(
wrk
->
busyobj
->
bereq
);
http_Teardown
(
wrk
->
busyobj
->
bereq
);
VBO_DerefBusyObj
(
wrk
,
&
wrk
->
busyobj
);
VBO_DerefBusyObj
(
wrk
,
&
wrk
->
busyobj
);
...
...
bin/varnishd/cache/cache_expire.c
View file @
fe8ec801
...
@@ -402,7 +402,7 @@ exp_timer(struct sess *sp, void *priv)
...
@@ -402,7 +402,7 @@ exp_timer(struct sess *sp, void *priv)
o
=
oc_getobj
(
sp
->
wrk
,
oc
);
o
=
oc_getobj
(
sp
->
wrk
,
oc
);
WSL
(
sp
->
wrk
->
vsl
,
SLT_ExpKill
,
0
,
"%u %.0f"
,
WSL
(
sp
->
wrk
->
vsl
,
SLT_ExpKill
,
0
,
"%u %.0f"
,
oc_getxid
(
sp
->
wrk
,
oc
),
EXP_Ttl
(
NULL
,
o
)
-
t
);
oc_getxid
(
sp
->
wrk
,
oc
),
EXP_Ttl
(
NULL
,
o
)
-
t
);
(
void
)
HSH_Deref
(
sp
->
wrk
,
oc
,
NULL
);
(
void
)
HSH_Deref
(
&
sp
->
wrk
->
stats
,
oc
,
NULL
);
}
}
NEEDLESS_RETURN
(
NULL
);
NEEDLESS_RETURN
(
NULL
);
}
}
...
@@ -446,7 +446,7 @@ EXP_NukeOne(struct worker *wrk, struct lru *lru)
...
@@ -446,7 +446,7 @@ EXP_NukeOne(struct worker *wrk, struct lru *lru)
/* XXX: bad idea for -spersistent */
/* XXX: bad idea for -spersistent */
WSL
(
wrk
->
vsl
,
SLT_ExpKill
,
0
,
"%u LRU"
,
oc_getxid
(
wrk
,
oc
));
WSL
(
wrk
->
vsl
,
SLT_ExpKill
,
0
,
"%u LRU"
,
oc_getxid
(
wrk
,
oc
));
(
void
)
HSH_Deref
(
wrk
,
oc
,
NULL
);
(
void
)
HSH_Deref
(
&
wrk
->
stats
,
oc
,
NULL
);
return
(
1
);
return
(
1
);
}
}
...
...
bin/varnishd/cache/cache_hash.c
View file @
fe8ec801
...
@@ -139,13 +139,13 @@ HSH_Cleanup(struct worker *wrk)
...
@@ -139,13 +139,13 @@ HSH_Cleanup(struct worker *wrk)
}
}
void
void
HSH_DeleteObjHead
(
struct
worker
*
wrk
,
struct
objhead
*
oh
)
HSH_DeleteObjHead
(
struct
dstat
*
ds
,
struct
objhead
*
oh
)
{
{
AZ
(
oh
->
refcnt
);
AZ
(
oh
->
refcnt
);
assert
(
VTAILQ_EMPTY
(
&
oh
->
objcs
));
assert
(
VTAILQ_EMPTY
(
&
oh
->
objcs
));
Lck_Delete
(
&
oh
->
mtx
);
Lck_Delete
(
&
oh
->
mtx
);
wrk
->
stats
.
n_objecthead
--
;
ds
->
n_objecthead
--
;
FREE_OBJ
(
oh
);
FREE_OBJ
(
oh
);
}
}
...
@@ -564,7 +564,7 @@ HSH_Purge(const struct sess *sp, struct objhead *oh, double ttl, double grace)
...
@@ -564,7 +564,7 @@ HSH_Purge(const struct sess *sp, struct objhead *oh, double ttl, double grace)
o
->
exp
.
ttl
=
ttl
;
o
->
exp
.
ttl
=
ttl
;
o
->
exp
.
grace
=
grace
;
o
->
exp
.
grace
=
grace
;
EXP_Rearm
(
o
);
EXP_Rearm
(
o
);
(
void
)
HSH_Deref
(
sp
->
wrk
,
NULL
,
&
o
);
(
void
)
HSH_Deref
(
&
sp
->
wrk
->
stats
,
NULL
,
&
o
);
}
}
WS_Release
(
sp
->
req
->
ws
,
0
);
WS_Release
(
sp
->
req
->
ws
,
0
);
}
}
...
@@ -588,7 +588,7 @@ HSH_Drop(struct worker *wrk)
...
@@ -588,7 +588,7 @@ HSH_Drop(struct worker *wrk)
o
->
exp
.
ttl
=
-
1
.;
o
->
exp
.
ttl
=
-
1
.;
if
(
o
->
objcore
!=
NULL
)
/* Pass has no objcore */
if
(
o
->
objcore
!=
NULL
)
/* Pass has no objcore */
HSH_Unbusy
(
wrk
);
HSH_Unbusy
(
wrk
);
(
void
)
HSH_Deref
(
wrk
,
NULL
,
&
wrk
->
sp
->
req
->
obj
);
(
void
)
HSH_Deref
(
&
wrk
->
stats
,
NULL
,
&
wrk
->
sp
->
req
->
obj
);
}
}
void
void
...
@@ -660,7 +660,7 @@ HSH_Ref(struct objcore *oc)
...
@@ -660,7 +660,7 @@ HSH_Ref(struct objcore *oc)
*/
*/
int
int
HSH_Deref
(
struct
worker
*
wrk
,
struct
objcore
*
oc
,
struct
object
**
oo
)
HSH_Deref
(
struct
dstat
*
ds
,
struct
objcore
*
oc
,
struct
object
**
oo
)
{
{
struct
object
*
o
=
NULL
;
struct
object
*
o
=
NULL
;
struct
objhead
*
oh
;
struct
objhead
*
oh
;
...
@@ -683,7 +683,7 @@ HSH_Deref(struct worker *wrk, struct objcore *oc, struct object **oo)
...
@@ -683,7 +683,7 @@ HSH_Deref(struct worker *wrk, struct objcore *oc, struct object **oo)
*/
*/
STV_Freestore
(
o
);
STV_Freestore
(
o
);
STV_free
(
o
->
objstore
);
STV_free
(
o
->
objstore
);
wrk
->
stats
.
n_object
--
;
ds
->
n_object
--
;
return
(
0
);
return
(
0
);
}
}
...
@@ -713,16 +713,16 @@ HSH_Deref(struct worker *wrk, struct objcore *oc, struct object **oo)
...
@@ -713,16 +713,16 @@ HSH_Deref(struct worker *wrk, struct objcore *oc, struct object **oo)
if
(
oc
->
methods
!=
NULL
)
{
if
(
oc
->
methods
!=
NULL
)
{
oc_freeobj
(
oc
);
oc_freeobj
(
oc
);
wrk
->
stats
.
n_object
--
;
ds
->
n_object
--
;
}
}
FREE_OBJ
(
oc
);
FREE_OBJ
(
oc
);
wrk
->
stats
.
n_objectcore
--
;
ds
->
n_objectcore
--
;
/* Drop our ref on the objhead */
/* Drop our ref on the objhead */
assert
(
oh
->
refcnt
>
0
);
assert
(
oh
->
refcnt
>
0
);
if
(
hash
->
deref
(
oh
))
if
(
hash
->
deref
(
oh
))
return
(
0
);
return
(
0
);
HSH_DeleteObjHead
(
wrk
,
oh
);
HSH_DeleteObjHead
(
ds
,
oh
);
return
(
0
);
return
(
0
);
}
}
...
...
bin/varnishd/hash/hash_critbit.c
View file @
fe8ec801
...
@@ -359,7 +359,7 @@ hcb_cleaner(struct sess *sp, void *priv)
...
@@ -359,7 +359,7 @@ hcb_cleaner(struct sess *sp, void *priv)
}
}
VTAILQ_FOREACH_SAFE
(
oh
,
&
dead_h
,
hoh_list
,
oh2
)
{
VTAILQ_FOREACH_SAFE
(
oh
,
&
dead_h
,
hoh_list
,
oh2
)
{
VTAILQ_REMOVE
(
&
dead_h
,
oh
,
hoh_list
);
VTAILQ_REMOVE
(
&
dead_h
,
oh
,
hoh_list
);
HSH_DeleteObjHead
(
wrk
,
oh
);
HSH_DeleteObjHead
(
&
wrk
->
stats
,
oh
);
}
}
Lck_Lock
(
&
hcb_mtx
);
Lck_Lock
(
&
hcb_mtx
);
VSTAILQ_CONCAT
(
&
dead_y
,
&
cool_y
);
VSTAILQ_CONCAT
(
&
dead_y
,
&
cool_y
);
...
...
bin/varnishd/hash/hash_slinger.h
View file @
fe8ec801
...
@@ -95,8 +95,8 @@ struct objhead {
...
@@ -95,8 +95,8 @@ struct objhead {
#define hoh_head _u.n.u_n_hoh_head
#define hoh_head _u.n.u_n_hoh_head
};
};
void
HSH_DeleteObjHead
(
struct
worker
*
w
,
struct
objhead
*
oh
);
void
HSH_DeleteObjHead
(
struct
dstat
*
,
struct
objhead
*
oh
);
int
HSH_Deref
(
struct
worker
*
w
,
struct
objcore
*
oc
,
struct
object
**
o
);
int
HSH_Deref
(
struct
dstat
*
,
struct
objcore
*
oc
,
struct
object
**
o
);
#endif
/* VARNISH_CACHE_CHILD */
#endif
/* VARNISH_CACHE_CHILD */
extern
const
struct
hash_slinger
hsl_slinger
;
extern
const
struct
hash_slinger
hsl_slinger
;
...
...
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