Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FlightOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Armin Luntzer
FlightOS
Commits
9d3af19d
Commit
9d3af19d
authored
8 years ago
by
Armin Luntzer
Browse files
Options
Downloads
Patches
Plain Diff
data processing network: have pn_get_next_pending_tracker() rotate the queue
parent
df7551b3
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/data_proc_net.c
+6
-15
6 additions, 15 deletions
lib/data_proc_net.c
with
6 additions
and
15 deletions
lib/data_proc_net.c
+
6
−
15
View file @
9d3af19d
...
...
@@ -219,17 +219,14 @@ void pn_queue_critical_trackers(struct proc_net *pn)
/**
* @brief locate the
firs
t tracker that holds at least one task
* @brief locate the
nex
t tracker that holds at least one task
*
* @param pn a struct proc_net
*
* @return a pointer to a struct proc_task or NULL if none was found
*
* @note empty trackers are moved to the end of the queue
*
* ideally, the tracker nodes would already be sorted so that the most critical
* tracker was the first item
* XXX implement that sometime...
* @note trackers are always moved to the end of the queue, critical trackers
* have priority
*/
struct
proc_tracker
*
pn_get_next_pending_tracker
(
struct
proc_net
*
pn
)
...
...
@@ -244,16 +241,17 @@ struct proc_tracker *pn_get_next_pending_tracker(struct proc_net *pn)
if
(
list_empty
(
&
pn
->
nodes
))
return
NULL
;
pn_queue_critical_trackers
(
pn
);
list_for_each_entry_safe
(
pt
,
p_tmp
,
&
pn
->
nodes
,
node
)
{
if
(
cnt
++
>
pn
->
n
)
break
;
pn_node_to_queue_tail
(
pn
,
pt
);
if
(
pt_track_tasks_pending
(
pt
))
return
pt
;
pn_node_to_queue_tail
(
pn
,
pt
);
}
return
NULL
;
...
...
@@ -362,9 +360,6 @@ int pn_process_next(struct proc_net *pn)
struct
proc_tracker
*
pt
;
/* make sure critical trackers are on top */
pn_queue_critical_trackers
(
pn
);
pt
=
pn_get_next_pending_tracker
(
pn
);
if
(
!
pt
)
return
cnt
;
...
...
@@ -382,10 +377,6 @@ int pn_process_next(struct proc_net *pn)
break
;
}
/* move processing task to end of queue */
pn_node_to_queue_tail
(
pn
,
pt
);
return
cnt
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment