Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kernel Program Behaviour Models
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
felixkhals
Kernel Program Behaviour Models
Commits
6538d597
Commit
6538d597
authored
2 years ago
by
fu5520tp
Browse files
Options
Downloads
Patches
Plain Diff
return task back to cfs after plane is done
parent
0e6fcc8e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kernel/sched/pb.c
+27
-22
27 additions, 22 deletions
kernel/sched/pb.c
with
27 additions
and
22 deletions
kernel/sched/pb.c
+
27
−
22
View file @
6538d597
...
...
@@ -157,30 +157,8 @@ EXPORT_SYMBOL(init_pb_rq);
static
void
enqueue_task_pb
(
struct
rq
*
rq
,
struct
task_struct
*
p
,
int
flags
)
{
struct
pb_rq
*
pb
=
&
(
rq
->
pb
);
bool
premature_finish
=
false
;
pb
->
waiting_on_io
=
0
;
pb
->
c_entry
++
;
/**
* Don't schedule a task that is dead. (e.g. plan was incorrect and program finished quicker)
* TODO: if we have multiple tasks structs try the next plan entry
*/
if
(
pb
->
c_entry
<
pb
->
size
&&
pb
->
plan
[
pb
->
c_entry
].
task_struct
->
state
==
TASK_DEAD
)
{
premature_finish
=
true
;
pb
->
is_initialized
=
0
;
}
if
(
pb
->
c_entry
>=
pb
->
size
||
premature_finish
)
{
if
(
premature_finish
)
{
printk
(
KERN_WARNING
"PLAN TERMINATED PREMATURELY
\n
"
);
}
else
{
printk
(
KERN_WARNING
"PLAN DONE
\n
"
);
}
}
printk
(
"DONE"
);
}
// task started IO and thus it is finished
...
...
@@ -191,6 +169,8 @@ static void dequeue_task_pb(struct rq *rq, struct task_struct *p, int flags)
u64
perf_counter
;
u64
counter_diff
;
u64
read_error
;
bool
premature_finish
=
false
;
if
(
pb
->
waiting_on_io
)
{
return
;
...
...
@@ -221,6 +201,31 @@ static void dequeue_task_pb(struct rq *rq, struct task_struct *p, int flags)
printk
(
KERN_WARNING
"PB TASK %llu RAN %llu INSTRUCTIONS TOO LONG
\n
"
,
pb
->
plan
[
pb
->
c_entry
].
task_id
,
over_time
);
}
pb
->
c_entry
++
;
/**
* Don't schedule a task that is dead. (e.g. plan was incorrect and program finished quicker)
* TODO: if we have multiple tasks structs try the next plan entry
*/
if
(
pb
->
c_entry
<
pb
->
size
&&
pb
->
plan
[
pb
->
c_entry
].
task_struct
->
state
==
TASK_DEAD
)
{
premature_finish
=
true
;
}
if
(
pb
->
c_entry
>=
pb
->
size
||
premature_finish
)
{
if
(
premature_finish
)
{
printk
(
KERN_WARNING
"PLAN TERMINATED PREMATURELY
\n
"
);
}
else
{
printk
(
KERN_WARNING
"PLAN DONE
\n
"
);
}
// set back to cfs for completion of task
pb
->
is_initialized
=
0
;
pb
->
plan
[
0
].
task_struct
->
sched_class
=
&
fair_sched_class
;
resched_curr
(
rq
);
}
}
static
void
yield_task_pb
(
struct
rq
*
rq
)
...
...
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