diff options
author | Jeremy Erickson <jerickso@cs.unc.edu> | 2012-05-31 15:31:09 -0400 |
---|---|---|
committer | Jeremy Erickson <jerickso@cs.unc.edu> | 2012-05-31 15:31:09 -0400 |
commit | 576933733ef752bdf7773e8e628be207b6615899 (patch) | |
tree | 06980ec4b3ede592ed6c57daecc3d5efaa193ff5 | |
parent | ded1aadf23470b9a170018f93809414a5a752839 (diff) |
Fix CPU count in G-FL
-rw-r--r-- | litmus/sched_gfl_split.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/litmus/sched_gfl_split.c b/litmus/sched_gfl_split.c index 9303ed97563b..9495c2962d71 100644 --- a/litmus/sched_gfl_split.c +++ b/litmus/sched_gfl_split.c | |||
@@ -71,12 +71,13 @@ inline static int get_slice_num(struct task_struct* t) | |||
71 | /* Returns the appropriate subjob deadline.*/ | 71 | /* Returns the appropriate subjob deadline.*/ |
72 | inline static lt_t get_proper_deadline(struct task_struct* t) | 72 | inline static lt_t get_proper_deadline(struct task_struct* t) |
73 | { | 73 | { |
74 | unsigned int num_cpus = num_online_cpus(); | ||
74 | return t->rt_param.job_params.release + | 75 | return t->rt_param.job_params.release + |
75 | ((t->rt_param.task_params.period * get_slice_num(t)) | 76 | ((t->rt_param.task_params.period * get_slice_num(t)) |
76 | / t->rt_param.task_params.split) | 77 | / t->rt_param.task_params.split) |
77 | /* G-FL correction */ | 78 | /* G-FL correction */ |
78 | - ((NR_CPUS - 1) * t->rt_param.task_params.exec_cost) | 79 | - ((num_cpus - 1) * t->rt_param.task_params.exec_cost) |
79 | / (NR_CPUS * t->rt_param.task_params.split); | 80 | / (num_cpus * t->rt_param.task_params.split); |
80 | } | 81 | } |
81 | 82 | ||
82 | /* Tells us if the current deadline is too small.*/ | 83 | /* Tells us if the current deadline is too small.*/ |