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
e1d456a7
Unverified
Commit
e1d456a7
authored
Jan 28, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce nodes_lock to be used by nodes on the tree
parent
902e3af2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
4 deletions
+13
-4
node.h
src/node.h
+2
-1
vdp_pesi.c
src/vdp_pesi.c
+6
-2
vdp_pesi.h
src/vdp_pesi.h
+3
-1
vmod_pesi.c
src/vmod_pesi.c
+2
-0
No files found.
src/node.h
View file @
e1d456a7
...
...
@@ -37,6 +37,7 @@ struct bytes_tree {
int
retval
;
struct
lock
tree_lock
;
struct
lock
nodes_lock
;
// esi_level > 1 signalling new data
pthread_cond_t
cond
;
struct
node
*
root
;
...
...
@@ -155,7 +156,7 @@ struct node_subreq {
struct
boc
*
boc
;
// oc is NULL if already transferred back into req
struct
objcore
*
oc
;
struct
lock
*
shared_lock
;
// == &tree->
tree
_lock
struct
lock
*
shared_lock
;
// == &tree->
nodes
_lock
pthread_cond_t
cond
;
// subreq to topreq delivery
int
done
;
...
...
src/vdp_pesi.c
View file @
e1d456a7
...
...
@@ -92,7 +92,9 @@ static void vped_close_vdp(struct req *, int, const struct vdp *);
static
void
assert_vdp_next_not
(
struct
req
*
,
const
struct
vdp
*
);
/* shared with vmod code */
struct
VSC_lck
*
lck_bytes_tree
,
*
lck_pesi_tasks
;
struct
VSC_lck
*
lck_bytes_tree
,
*
lck_bytes_nodes
,
*
lck_pesi_tasks
;
extern
struct
mempool
*
mempool
;
struct
mempool
*
mempool
=
NULL
;
...
...
@@ -661,6 +663,7 @@ bytes_tree_init(struct bytes_tree *bytes_tree, struct node *root_node)
INIT_OBJ
(
bytes_tree
,
BYTES_TREE_MAGIC
);
Lck_New
(
&
bytes_tree
->
tree_lock
,
lck_bytes_tree
);
Lck_New
(
&
bytes_tree
->
nodes_lock
,
lck_bytes_nodes
);
AZ
(
pthread_cond_init
(
&
bytes_tree
->
cond
,
NULL
));
AZ
(
bytes_tree
->
retval
);
AZ
(
bytes_tree
->
npending
);
...
...
@@ -705,6 +708,7 @@ bytes_tree_fini(struct bytes_tree *bytes_tree, struct vdp_ctx *vdc)
AZ
(
pthread_cond_destroy
(
&
bytes_tree
->
cond
));
tree_free
(
vdc
,
bytes_tree
->
root
);
Lck_Delete
(
&
bytes_tree
->
nodes_lock
);
}
static
void
...
...
@@ -1485,7 +1489,7 @@ vped_deliver(struct req *req, struct boc *boc, int wantbody)
HSH_Ref
(
req
->
objcore
);
node
->
subreq
.
oc
=
req
->
objcore
;
node
->
subreq
.
shared_lock
=
&
tree
->
tree
_lock
;
node
->
subreq
.
shared_lock
=
&
tree
->
nodes
_lock
;
AZ
(
pthread_cond_init
(
&
node
->
subreq
.
cond
,
NULL
));
AZ
(
node
->
subreq
.
done
);
...
...
src/vdp_pesi.h
View file @
e1d456a7
...
...
@@ -29,7 +29,9 @@
* interfaces shared between vdp_pesi.c and vmod_pesi.c
*/
extern
struct
VSC_lck
*
lck_bytes_tree
,
*
lck_pesi_tasks
;
extern
struct
VSC_lck
*
lck_bytes_tree
,
*
lck_bytes_nodes
,
*
lck_pesi_tasks
;
extern
const
struct
vdp
VDP_pesi
;
/* ------------------------------------------------------------
...
...
src/vmod_pesi.c
View file @
e1d456a7
...
...
@@ -350,9 +350,11 @@ vmod_event(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
if
(
loadcnt
++
==
0
)
{
AZ
(
vsc_seg
);
lck_bytes_tree
=
Lck_CreateClass
(
&
vsc_seg
,
"pesi.buf"
);
lck_bytes_nodes
=
Lck_CreateClass
(
&
vsc_seg
,
"pesi.nodes"
);
lck_pesi_tasks
=
Lck_CreateClass
(
&
vsc_seg
,
"pesi.tasks"
);
lck_stats
=
Lck_CreateClass
(
&
vsc_seg
,
"pesi.stats"
);
AN
(
lck_bytes_tree
);
AN
(
lck_bytes_nodes
);
AN
(
lck_pesi_tasks
);
AZ
(
pesi_vsc_seg
);
stats
=
VSC_pesi_New
(
NULL
,
&
pesi_vsc_seg
,
""
);
...
...
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