diff --git a/kernel/sched/pb.c b/kernel/sched/pb.c index f124823b3bedd7db6fd5a0daea147077404ebc84..866ebb8ca60f6da98ec5b1ff1cdf6c40e247d83e 100644 --- a/kernel/sched/pb.c +++ b/kernel/sched/pb.c @@ -2,9 +2,9 @@ //#include "sched.h" /* - * It is possible to initialize a runqueue only if no plan is currently executed + * It is possible submit a plan only if no plan is currently executed */ -int pb_init_rq(struct pb_init_struct *initstr, struct rq *rq) +int pb_submit_plan(struct pb_init_struct *initstr, struct rq *rq) { /* * Must be volatile to ensure correct initialization order diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index c35e8c52f55a20062b846af687bccb46ad47353f..56d62d30e7e1477f8065af4cb4b0367b45bc0c9f 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -504,44 +504,44 @@ struct cfs_rq { * Mode of the PB scheduler */ enum pb_mode{ - PB_DISABLED_MODE, // PB scheduler is disabled (no plan available) - PB_EXEC_MODE, // PB task is being executed - PB_ADMIN_MODE // Admin task is being executed + PB_DISABLED_MODE, // PB scheduler is disabled (no plan available) + PB_EXEC_MODE, // PB task is being executed + PB_ADMIN_MODE // Admin task is being executed }; #define PB_MAX_PLAN_LENGTH 100 /* - * Entry for PB-Task + * A PB-Task consists of one or more 'plan_entry' */ struct plan_entry { - u64 n_instr; // number of instructions for a task + u64 n_instr; // number of instructions in the entry u64 task_id; - struct task_struct *task_struct; // linux task struct + struct task_struct *task_struct; // linux task struct }; struct pb_init_struct { - struct plan_entry *plan; // PB plan - unsigned int size; // size of the plan + struct plan_entry *plan; // plan + unsigned int size; // size of the plan - u64 n_pb_cycles; // amount of timer ticks before admin tasks are allowed to run - u64 n_admin_cycles; // amount of timer ticks before PB tasks are allowed to run + u64 n_pb_cycles; // amount of timer ticks before admin tasks are allowed to run + u64 n_admin_cycles; // amount of timer ticks before PB tasks are allowed to run }; struct pb_rq { - struct plan_entry *plan; // PB plan - unsigned int size; // size of the plan - unsigned int c_entry; // index of currently executed entry + struct plan_entry *plan; // plan + unsigned int size; // size of the plan + unsigned int c_entry; // index of currently executed entry - u64 n_pb_cycles; // amount of timer ticks before admin tasks are allowed to run - u64 count_pb_cycles; // current timer tick count for PB tasks + u64 n_pb_cycles; // amount of timer ticks before admin tasks are allowed to run + u64 count_pb_cycles; // current timer tick count for PB tasks - u64 n_admin_cycles; // amount of timer ticks before PB tasks are allowed to run - u64 count_admin_cycles; // current timer tick count for admin tasks + u64 n_admin_cycles; // amount of timer ticks before PB tasks are allowed to run + u64 count_admin_cycles; // current timer tick count for admin tasks enum pb_mode mode; - struct perf_event *pevent; // linux perf handle + struct perf_event *pevent; // linux perf handle /* * flag determining whether the plan is completely initialized and should be run @@ -550,7 +550,7 @@ struct pb_rq { volatile int is_initialized; }; -int pb_init_rq(struct pb_init_struct *initstr, struct rq *rq); +int pb_submit_plan(struct pb_init_struct *initstr, struct rq *rq); static inline int rt_bandwidth_enabled(void) { @@ -2074,8 +2074,8 @@ extern void init_rt_rq(struct rt_rq *rt_rq); extern void init_pb_rq(struct pb_rq *pb_rq); extern void init_dl_rq(struct dl_rq *dl_rq); -extern void set_pb_plan_size(struct pb_rq *pb_rq, unsigned int size); -extern void set_pb_plan_entry(struct pb_rq *pb_rq, unsigned int i, u64 n_instr, u64 task_id, struct task_struct *task_struct); +extern void set_pb_plan_size(struct pb_rq *pb_rq, unsigned int size); // TODO: delet dis +extern void set_pb_plan_entry(struct pb_rq *pb_rq, unsigned int i, u64 n_instr, u64 task_id, struct task_struct *task_struct); // TODO: delet dis extern void cfs_bandwidth_usage_inc(void); extern void cfs_bandwidth_usage_dec(void);