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
9f4e163e
Commit
9f4e163e
authored
Aug 01, 2019
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
for tree traversal, register the thread which got to the front
parent
55e1abb0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
vdp_pesi.c
src/vdp_pesi.c
+11
-4
No files found.
src/vdp_pesi.c
View file @
9f4e163e
...
@@ -246,6 +246,7 @@ struct bytes_tree {
...
@@ -246,6 +246,7 @@ struct bytes_tree {
pthread_cond_t
cond
;
pthread_cond_t
cond
;
struct
node
*
root
;
struct
node
*
root
;
struct
node
*
front
;
struct
node
*
front
;
struct
worker
*
front_owner
;
struct
worker
*
unpend_owner
;
struct
worker
*
unpend_owner
;
int
npending
;
int
npending
;
int
retval
;
int
retval
;
...
@@ -1306,6 +1307,11 @@ ved_decode_len(struct req *req, const uint8_t **pp)
...
@@ -1306,6 +1307,11 @@ ved_decode_len(struct req *req, const uint8_t **pp)
* to minimize lock contention, we walk the tree and gather work on a list
* to minimize lock contention, we walk the tree and gather work on a list
*/
*/
#define set_front(tree, node, wrk) do { \
(tree)->front = node; \
(tree)->front_owner = wrk; \
} while(0)
static
void
static
void
bytes_unpend_worklist
(
struct
req
*
req
,
struct
bytes_tree
*
tree
,
bytes_unpend_worklist
(
struct
req
*
req
,
struct
bytes_tree
*
tree
,
struct
node_head
*
work
)
struct
node_head
*
work
)
...
@@ -1363,7 +1369,7 @@ bytes_unpend_worklist(struct req *req, struct bytes_tree *tree,
...
@@ -1363,7 +1369,7 @@ bytes_unpend_worklist(struct req *req, struct bytes_tree *tree,
VSLdbgv
(
req
,
"bytes_unpend: return at "
VSLdbgv
(
req
,
"bytes_unpend: return at "
"node %p state %u - await sibling"
,
"node %p state %u - await sibling"
,
node
,
node
->
state
);
node
,
node
->
state
);
tree
->
front
=
node
;
set_front
(
tree
,
node
,
req
->
wrk
)
;
return
;
return
;
}
}
...
@@ -1380,7 +1386,7 @@ bytes_unpend_worklist(struct req *req, struct bytes_tree *tree,
...
@@ -1380,7 +1386,7 @@ bytes_unpend_worklist(struct req *req, struct bytes_tree *tree,
AZ
(
node
);
AZ
(
node
);
VSLdbgv
(
req
,
"bytes_unpend: reached root"
);
VSLdbgv
(
req
,
"bytes_unpend: reached root"
);
tree
->
front
=
tree
->
root
;
set_front
(
tree
,
tree
->
root
,
req
->
wrk
)
;
return
;
return
;
}
}
...
@@ -1388,7 +1394,7 @@ bytes_unpend_worklist(struct req *req, struct bytes_tree *tree,
...
@@ -1388,7 +1394,7 @@ bytes_unpend_worklist(struct req *req, struct bytes_tree *tree,
VSLdbgv
(
req
,
"bytes_unpend: return at "
VSLdbgv
(
req
,
"bytes_unpend: return at "
"node %p state %u - private"
,
"node %p state %u - private"
,
node
,
node
->
state
);
node
,
node
->
state
);
tree
->
front
=
node
;
set_front
(
tree
,
node
,
req
->
wrk
)
;
return
;
return
;
}
}
...
@@ -1402,7 +1408,7 @@ bytes_unpend_worklist(struct req *req, struct bytes_tree *tree,
...
@@ -1402,7 +1408,7 @@ bytes_unpend_worklist(struct req *req, struct bytes_tree *tree,
if
(
node
->
state
==
ST_OPEN
)
{
if
(
node
->
state
==
ST_OPEN
)
{
VSLdbg
(
req
,
"bytes_unpend: init node no children"
);
VSLdbg
(
req
,
"bytes_unpend: init node no children"
);
tree
->
front
=
node
;
set_front
(
tree
,
node
,
req
->
wrk
)
;
return
;
return
;
}
}
...
@@ -1438,6 +1444,7 @@ bytes_unpend_worklist(struct req *req, struct bytes_tree *tree,
...
@@ -1438,6 +1444,7 @@ bytes_unpend_worklist(struct req *req, struct bytes_tree *tree,
check
=
CHK_ANY
;
check
=
CHK_ANY
;
}
}
}
}
#undef set_front
/*
/*
* restore the original subreq state and take care that we do not mess up flags,
* restore the original subreq state and take care that we do not mess up flags,
...
...
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