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
73d2ae78
Commit
73d2ae78
authored
Aug 01, 2019
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rework tree traversal
parent
07e55326
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
26 deletions
+22
-26
vdp_pesi.c
src/vdp_pesi.c
+22
-26
No files found.
src/vdp_pesi.c
View file @
73d2ae78
...
@@ -1302,15 +1302,8 @@ ved_decode_len(struct req *req, const uint8_t **pp)
...
@@ -1302,15 +1302,8 @@ ved_decode_len(struct req *req, const uint8_t **pp)
return
(
l
);
return
(
l
);
}
}
/* VDP pesi_buf */
/*
/*
* to minimize lock contention, we walk the tree looking for work
* to minimize lock contention, we walk the tree and gather work on a list
*
* because pointers in data nodes may depend on objcore refs, we return when we
* are done with a subtree (iow, when we need to go to an undelivered node)
*
* so basically we work depth first, then right, but not up
*/
*/
static
void
static
void
...
@@ -1337,8 +1330,6 @@ bytes_unpend_worklist(struct req *req, struct bytes_tree *tree,
...
@@ -1337,8 +1330,6 @@ bytes_unpend_worklist(struct req *req, struct bytes_tree *tree,
CHECK_OBJ_NOTNULL
(
tree
->
front
,
NODE_MAGIC
);
CHECK_OBJ_NOTNULL
(
tree
->
front
,
NODE_MAGIC
);
CHECK_OBJ_NOTNULL
(
tree
->
root
,
NODE_MAGIC
);
CHECK_OBJ_NOTNULL
(
tree
->
root
,
NODE_MAGIC
);
assert
(
req
==
tree
->
root
->
nexus
.
req
);
assert
(
req
->
esi_level
==
0
);
assert
(
req
->
esi_level
==
0
);
if
(
tree
->
root
->
state
==
ST_DELIVERED
)
{
if
(
tree
->
root
->
state
==
ST_DELIVERED
)
{
...
@@ -1347,6 +1338,8 @@ bytes_unpend_worklist(struct req *req, struct bytes_tree *tree,
...
@@ -1347,6 +1338,8 @@ bytes_unpend_worklist(struct req *req, struct bytes_tree *tree,
return
;
return
;
}
}
/* XXX what if we are a different worker and within a tree ?*/
/* when starting, we do not want to see any ST_UNPENDING nodes */
/* when starting, we do not want to see any ST_UNPENDING nodes */
check
=
CHK_DELI
;
check
=
CHK_DELI
;
...
@@ -1366,26 +1359,28 @@ bytes_unpend_worklist(struct req *req, struct bytes_tree *tree,
...
@@ -1366,26 +1359,28 @@ bytes_unpend_worklist(struct req *req, struct bytes_tree *tree,
continue
;
continue
;
}
}
if
(
node
->
parent
&&
node
->
parent
->
state
!=
ST_OPEN
)
{
if
(
node
->
parent
&&
node
->
parent
->
state
==
ST_OPEN
)
{
if
(
VSTAILQ_EMPTY
(
work
))
{
tree
->
front
=
node
;
VSLdbgv
(
req
,
"bytes_unpend: return at "
"node %p state %u - await sibling"
,
node
,
node
->
state
);
return
;
}
/* up and right */
node
=
node
->
parent
;
node
=
node
->
parent
;
while
(
node
!=
NULL
)
{
next
=
VSTAILQ_NEXT
(
node
,
sibling
);
if
(
next
!=
NULL
)
{
node
=
next
;
continue
;
continue
;
}
}
/* need to DELIVER children of this parent
node
=
node
->
parent
;
* first, so we can unref any storage
* XXX this comment is probably obsolete -
* rethink
*/
tree
->
front
=
node
->
parent
;
VSLdbgv
(
req
,
"bytes_unpend: return at "
"node %p state %u"
,
node
,
node
->
state
);
return
;
}
}
tree
->
front
=
node
;
AZ
(
node
);
VSLdbgv
(
req
,
"bytes_unpend: return at "
VSLdbgv
(
req
,
"bytes_unpend: reached root"
);
"node %p state %u - await sibling"
,
tree
->
front
=
tree
->
root
;
node
,
node
->
state
);
return
;
return
;
}
}
...
@@ -1399,6 +1394,7 @@ bytes_unpend_worklist(struct req *req, struct bytes_tree *tree,
...
@@ -1399,6 +1394,7 @@ bytes_unpend_worklist(struct req *req, struct bytes_tree *tree,
assert_node
(
node
,
CHK_PEND
);
assert_node
(
node
,
CHK_PEND
);
/* XXX only enter ST_OPEN if we own it */
if
(
node
->
type
==
T_NEXUS
)
{
if
(
node
->
type
==
T_NEXUS
)
{
node
=
VSTAILQ_FIRST
(
&
node
->
nexus
.
children
);
node
=
VSTAILQ_FIRST
(
&
node
->
nexus
.
children
);
continue
;
continue
;
...
...
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