Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvdp-pesi
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
uplex-varnish
libvdp-pesi
Commits
33a3d782
Commit
33a3d782
authored
Jul 29, 2019
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mempool init/fini on the warm/cold events for the first/last instance.
parent
871da25b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
8 deletions
+31
-8
00basic.vtc
src/tests/00basic.vtc
+14
-0
vdp_pesi.c
src/vdp_pesi.c
+17
-8
No files found.
src/tests/00basic.vtc
View file @
33a3d782
...
...
@@ -35,6 +35,20 @@ varnish v1 -expect MEMPOOL.pesi.pool > 0
varnish v1 -expect MEMPOOL.pesi.sz_wanted > 0
varnish v1 -expect MEMPOOL.pesi.sz_actual > 0
varnish v1 -cli "vcl.state vcl2 cold"
varnish v1 -vsc MEMPOOL.pesi.*
varnish v1 -expect MEMPOOL.pesi.pool > 0
varnish v1 -expect MEMPOOL.pesi.sz_wanted > 0
varnish v1 -expect MEMPOOL.pesi.sz_actual > 0
varnish v1 -cli "vcl.state vcl2 warm"
varnish v1 -vsc MEMPOOL.pesi.*
varnish v1 -expect MEMPOOL.pesi.pool > 0
varnish v1 -expect MEMPOOL.pesi.sz_wanted > 0
varnish v1 -expect MEMPOOL.pesi.sz_actual > 0
varnish v1 -cli "vcl.show vcl1"
varnish v1 -cli "vcl.use vcl2"
varnish v1 -cli "vcl.discard vcl1"
...
...
src/vdp_pesi.c
View file @
33a3d782
...
...
@@ -285,7 +285,7 @@ fini_data(struct req *req, struct node *node);
/* shared object globals */
static
unsigned
loadcnt
=
0
;
static
unsigned
loadcnt
=
0
,
warmcnt
=
0
;
static
struct
VSC_lck
*
lck_bytes_tree
,
*
lck_pesi_tree
;
static
struct
vsc_seg
*
vsc_seg
=
NULL
;
static
struct
mempool
*
mempool
=
NULL
;
...
...
@@ -2625,27 +2625,36 @@ vmod_event(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
"pesi.pesi_tree"
);
AN
(
lck_bytes_tree
);
AN
(
lck_pesi_tree
);
AZ
(
mempool
);
mempool
=
mpl_init
();
AN
(
mempool
);
}
VRT_AddVDP
(
ctx
,
&
VDP_pesi
);
return
(
0
)
;
break
;
case
VCL_EVENT_DISCARD
:
VRT_RemoveVDP
(
ctx
,
&
VDP_pesi
);
AN
(
loadcnt
);
if
(
--
loadcnt
==
0
)
{
if
(
--
loadcnt
==
0
)
Lck_DestroyClass
(
&
vsc_seg
);
break
;
case
VCL_EVENT_WARM
:
if
(
warmcnt
++
==
0
)
{
AZ
(
mempool
);
mempool
=
mpl_init
();
AN
(
mempool
);
}
break
;
case
VCL_EVENT_COLD
:
AN
(
warmcnt
);
if
(
--
warmcnt
==
0
)
{
AN
(
mempool
);
mpl_fini
(
&
mempool
);
AZ
(
mempool
);
}
return
(
0
)
;
break
;
default:
return
(
0
);
WRONG
(
"Illegal event enum"
);
}
return
(
0
);
}
/* Functions */
...
...
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