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
38e1bec6
Commit
38e1bec6
authored
2 years ago
by
mandersch
Browse files
Options
Downloads
Patches
Plain Diff
Update Module Template to use seperate task_structs for each plan entry
parent
aa7a8b3d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
kernel/sched/pb.c
+4
-0
4 additions, 0 deletions
kernel/sched/pb.c
pb_utils/mod_gen/tmpl/module.tt
+15
-7
15 additions, 7 deletions
pb_utils/mod_gen/tmpl/module.tt
with
19 additions
and
7 deletions
kernel/sched/pb.c
+
4
−
0
View file @
38e1bec6
...
...
@@ -246,6 +246,10 @@ static void task_tick_pb(struct rq *rq, struct task_struct *p, int queued)
pb
->
count_pb_cycles
++
;
next_mode
=
determine_next_mode_pb
(
rq
);
if
(
pb
->
mode
!=
PB_DISABLED_MODE
)
{
// printk("TICK");
}
if
(
pb
->
is_initialized
&&
next_mode
!=
PB_EXEC_MODE
)
{
resched_curr
(
rq
);
}
...
...
This diff is collapsed.
Click to expand it.
pb_utils/mod_gen/tmpl/module.tt
+
15
−
7
View file @
38e1bec6
...
...
@@ -11,24 +11,32 @@ MODULE_DESCRIPTION("PB Scheduler - Module that sets a proxy task and scheduling
static int loop_thread_func(void *data)
{
unsigned int c = 0;
while (!kthread_should_stop()) {
printk(KERN_WARNING "Hello from Module.\n");
// while (!kthread_should_stop()) {
int a = 0;
printk(KERN_WARNING "A.\n");
set_current_state(TASK_INTERRUPTIBLE);
for (;a < 200000; a++){}
schedule();
printk(KERN_WARNING "B.\n");
// schedule();
c++;
}
// }
printk(KERN_WARNING "Bye from module.\n");
return 0;
}
static void init_rq(struct rq *rq)
{
struct pb_rq *pb_rq = &rq->pb;
struct task_struct *proxy_task;
proxy_task = kthread_create(loop_thread_func, NULL, "PB proxy thread");
proxy_task->sched_class = &pb_sched_class;
struct task_struct **proxy_task;
proxy_task = (struct task_struct **) kmalloc(sizeof(struct task_struct*) * [% plan_size %] , GFP_KERNEL);
int i;
for (i = 0; i < [% plan_size %]; i++) {
proxy_task[i] = kthread_create(loop_thread_func, NULL, "PB proxy thread");
proxy_task[i]->sched_class = &pb_sched_class;
}
set_pb_plan_size(pb_rq, [% plan_size %]);
[% FOREACH entry IN plan %]set_pb_plan_entry(pb_rq, [%entry.index%], [%entry.exec_t%], [%entry.idle_t%], proxy_task);
[% FOREACH entry IN plan %]set_pb_plan_entry(pb_rq, [%entry.index%], [%entry.exec_t%], [%entry.idle_t%], proxy_task
[[%entry.index%]]
);
[% END %]
pb_submit_plan(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