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
d6799345
Commit
d6799345
authored
Jan 14, 2019
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Now that we have decided bump VRT_MAJOR, drop the reqtop struct
again and all the overhead it brought.
parent
b9708eac
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
18 additions
and
69 deletions
+18
-69
cache.h
bin/varnishd/cache/cache.h
+2
-7
cache_esi_deliver.c
bin/varnishd/cache/cache_esi_deliver.c
+2
-12
cache_panic.c
bin/varnishd/cache/cache_panic.c
+5
-16
cache_req.c
bin/varnishd/cache/cache_req.c
+5
-20
cache_req_fsm.c
bin/varnishd/cache/cache_req_fsm.c
+1
-0
cache_varnishd.h
bin/varnishd/cache/cache_varnishd.h
+0
-1
cache_vcl.c
bin/varnishd/cache/cache_vcl.c
+2
-5
cache_vrt_priv.c
bin/varnishd/cache/cache_vrt_priv.c
+1
-7
cache_vrt_vcl.c
bin/varnishd/cache/cache_vrt_vcl.c
+0
-1
No files found.
bin/varnishd/cache/cache.h
View file @
d6799345
...
...
@@ -443,11 +443,6 @@ struct busyobj {
/*--------------------------------------------------------------------*/
struct
reqtop
{
unsigned
magic
;
#define REQTOP_MAGIC 0x57fbda52
struct
req
*
topreq
;
};
struct
req
{
unsigned
magic
;
...
...
@@ -458,7 +453,7 @@ struct req {
enum
sess_close
doclose
;
int
restarts
;
int
esi_level
;
struct
req
top
*
top
;
/* esi_level == 0 request */
struct
req
*
topreq
;
/* esi_level == 0 request */
#define REQ_FLAG(l, r, w, d) unsigned l:1;
#include "tbl/req_flags.h"
...
...
@@ -537,7 +532,7 @@ struct req {
struct
vrt_privs
privs
[
1
];
};
#define IS_TOPREQ(req) ((req)->top
== NULL || (req)->top->top
req == (req))
#define IS_TOPREQ(req) ((req)->topreq == (req))
/*--------------------------------------------------------------------
* Struct sess is a high memory-load structure because sessions typically
...
...
bin/varnishd/cache/cache_esi_deliver.c
View file @
d6799345
...
...
@@ -112,7 +112,7 @@ ved_include(struct req *preq, const char *src, const char *host,
enum
req_fsm_nxt
s
;
CHECK_OBJ_NOTNULL
(
preq
,
REQ_MAGIC
);
CHECK_OBJ_NOTNULL
(
preq
->
top
,
REQTOP
_MAGIC
);
CHECK_OBJ_NOTNULL
(
preq
->
top
req
,
REQ
_MAGIC
);
sp
=
preq
->
sp
;
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
CHECK_OBJ_NOTNULL
(
ecx
,
ECX_MAGIC
);
...
...
@@ -138,7 +138,7 @@ ved_include(struct req *preq, const char *src, const char *host,
req
->
esi_level
=
preq
->
esi_level
+
1
;
req
->
top
=
preq
->
top
;
req
->
top
req
=
preq
->
topreq
;
HTTP_Setup
(
req
->
http
,
req
->
ws
,
req
->
vsl
,
SLT_ReqMethod
);
HTTP_Dup
(
req
->
http
,
preq
->
http0
);
...
...
@@ -258,16 +258,6 @@ ved_vdp_esi_init(struct req *req, void **priv)
*
priv
=
ecx
;
RFC2616_Weaken_Etag
(
req
->
resp
);
if
(
IS_TOPREQ
(
req
))
{
Req_MakeTop
(
req
);
if
(
req
->
top
==
NULL
)
{
VSLb
(
req
->
vsl
,
SLT_Error
,
"(top)request workspace overflow"
);
Req_Fail
(
req
,
SC_OVERLOAD
);
return
(
-
1
);
}
}
req
->
res_mode
|=
RES_ESI
;
if
(
req
->
resp_len
!=
0
)
req
->
resp_len
=
-
1
;
...
...
bin/varnishd/cache/cache_panic.c
View file @
d6799345
...
...
@@ -455,20 +455,6 @@ pan_busyobj(struct vsb *vsb, const struct busyobj *bo)
/*--------------------------------------------------------------------*/
static
void
pan_top
(
struct
vsb
*
vsb
,
const
struct
reqtop
*
top
)
{
VSB_printf
(
vsb
,
"top = %p {
\n
"
,
top
);
if
(
PAN_already
(
vsb
,
top
))
return
;
VSB_indent
(
vsb
,
2
);
pan_req
(
vsb
,
top
->
topreq
);
VSB_indent
(
vsb
,
-
2
);
VSB_printf
(
vsb
,
"},
\n
"
);
}
/*--------------------------------------------------------------------*/
static
void
pan_req
(
struct
vsb
*
vsb
,
const
struct
req
*
req
)
{
...
...
@@ -542,8 +528,11 @@ pan_req(struct vsb *vsb, const struct req *req)
pan_privs
(
vsb
,
req
->
privs
);
if
(
req
->
top
!=
NULL
)
pan_top
(
vsb
,
req
->
top
);
VSB_printf
(
vsb
,
"topreq = {
\n
"
);
VSB_indent
(
vsb
,
2
);
pan_req
(
vsb
,
req
->
topreq
);
VSB_indent
(
vsb
,
-
2
);
VSB_printf
(
vsb
,
"},
\n
"
);
VSB_indent
(
vsb
,
-
2
);
VSB_printf
(
vsb
,
"},
\n
"
);
...
...
bin/varnishd/cache/cache_req.c
View file @
d6799345
...
...
@@ -63,6 +63,7 @@ Req_AcctLogCharge(struct VSC_main_wrk *ds, struct req *req)
(
uintmax_t
)(
a
->
resp_hdrbytes
+
a
->
resp_bodybytes
));
}
AN
(
req
->
topreq
);
if
(
IS_TOPREQ
(
req
))
{
#define ACCT(foo) ds->s_##foo += a->foo;
#include "tbl/acct_fields_req.h"
...
...
@@ -147,6 +148,8 @@ Req_New(const struct worker *wrk, struct sess *sp)
req
->
t_prev
=
NAN
;
req
->
t_req
=
NAN
;
req
->
topreq
=
req
;
return
(
req
);
}
...
...
@@ -174,7 +177,7 @@ Req_Release(struct req *req)
MPL_AssertSane
(
req
);
VSL_Flush
(
req
->
vsl
,
0
);
req
->
sp
=
NULL
;
req
->
top
=
NULL
;
req
->
top
req
=
NULL
;
MPL_Free
(
pp
->
mpl_req
,
req
);
}
...
...
@@ -193,7 +196,6 @@ Req_Rollback(struct req *req)
if
(
WS_Overflowed
(
req
->
ws
))
req
->
wrk
->
stats
->
ws_client_overflow
++
;
WS_Reset
(
req
->
ws
,
req
->
ws_req
);
req
->
top
=
NULL
;
}
/*----------------------------------------------------------------------
...
...
@@ -207,6 +209,7 @@ Req_Cleanup(struct sess *sp, struct worker *wrk, struct req *req)
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
->
topreq
,
REQ_MAGIC
);
assert
(
sp
==
req
->
sp
);
req
->
director_hint
=
NULL
;
...
...
@@ -238,7 +241,6 @@ Req_Cleanup(struct sess *sp, struct worker *wrk, struct req *req)
req
->
hash_ignore_busy
=
0
;
req
->
esi_level
=
0
;
req
->
is_hit
=
0
;
req
->
top
=
0
;
if
(
WS_Overflowed
(
req
->
ws
))
wrk
->
stats
->
ws_client_overflow
++
;
...
...
@@ -257,20 +259,3 @@ Req_Fail(struct req *req, enum sess_close reason)
AN
(
req
->
transport
->
req_fail
);
req
->
transport
->
req_fail
(
req
,
reason
);
}
/*----------------------------------------------------------------------
*/
void
Req_MakeTop
(
struct
req
*
req
)
{
CHECK_OBJ_ORNULL
(
req
->
top
,
REQTOP_MAGIC
);
if
(
req
->
top
!=
NULL
)
return
;
req
->
top
=
WS_Alloc
(
req
->
ws
,
sizeof
*
req
->
top
);
if
(
req
->
top
!=
NULL
)
{
INIT_OBJ
(
req
->
top
,
REQTOP_MAGIC
);
req
->
top
->
topreq
=
req
;
}
}
bin/varnishd/cache/cache_req_fsm.c
View file @
d6799345
...
...
@@ -1021,6 +1021,7 @@ CNT_Embark(struct worker *wrk, struct req *req)
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
->
topreq
,
REQ_MAGIC
);
/* wrk can have changed for restarts */
req
->
vfc
->
wrk
=
req
->
wrk
=
wrk
;
...
...
bin/varnishd/cache/cache_varnishd.h
View file @
d6799345
...
...
@@ -314,7 +314,6 @@ void Req_Rollback(struct req *req);
void
Req_Cleanup
(
struct
sess
*
sp
,
struct
worker
*
wrk
,
struct
req
*
req
);
void
Req_Fail
(
struct
req
*
req
,
enum
sess_close
reason
);
void
Req_AcctLogCharge
(
struct
VSC_main_wrk
*
,
struct
req
*
);
void
Req_MakeTop
(
struct
req
*
req
);
/* cache_req_body.c */
int
VRB_Ignore
(
struct
req
*
);
...
...
bin/varnishd/cache/cache_vcl.c
View file @
d6799345
...
...
@@ -91,15 +91,12 @@ VCL_Req2Ctx(struct vrt_ctx *ctx, struct req *req)
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
CHECK_OBJ_ORNULL
(
req
->
topreq
,
REQ_MAGIC
);
ctx
->
vcl
=
req
->
vcl
;
ctx
->
vsl
=
req
->
vsl
;
ctx
->
http_req
=
req
->
http
;
CHECK_OBJ_ORNULL
(
req
->
top
,
REQTOP_MAGIC
);
if
(
req
->
top
!=
NULL
)
ctx
->
http_req_top
=
req
->
top
->
topreq
->
http
;
else
ctx
->
http_req_top
=
req
->
http
;
ctx
->
http_req_top
=
req
->
topreq
->
http
;
ctx
->
http_resp
=
req
->
resp
;
ctx
->
req
=
req
;
ctx
->
sp
=
req
->
sp
;
...
...
bin/varnishd/cache/cache_vrt_priv.c
View file @
d6799345
...
...
@@ -166,13 +166,7 @@ VRT_priv_top(VRT_CTX, const void *vmod_id)
NEEDLESS
(
return
NULL
);
}
CHECK_OBJ_NOTNULL
(
ctx
->
req
,
REQ_MAGIC
);
if
(
ctx
->
req
->
top
!=
NULL
)
{
CHECK_OBJ_NOTNULL
(
ctx
->
req
->
top
,
REQTOP_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
->
req
->
top
->
topreq
,
REQ_MAGIC
);
req
=
ctx
->
req
->
top
->
topreq
;
}
else
{
req
=
ctx
->
req
;
}
req
=
ctx
->
req
->
topreq
;
CAST_OBJ_NOTNULL
(
vps
,
req
->
privs
,
VRT_PRIVS_MAGIC
);
return
(
vrt_priv_dynamic
(
req
->
ws
,
vps
,
(
uintptr_t
)
vmod_id
));
}
...
...
bin/varnishd/cache/cache_vrt_vcl.c
View file @
d6799345
...
...
@@ -430,7 +430,6 @@ vcl_call_method(struct worker *wrk, struct req *req, struct busyobj *bo,
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
->
sp
,
SESS_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
->
vcl
,
VCL_MAGIC
);
CHECK_OBJ_ORNULL
(
req
->
top
,
REQTOP_MAGIC
);
VCL_Req2Ctx
(
&
ctx
,
req
);
}
if
(
bo
!=
NULL
)
{
...
...
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