diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2011-04-15 19:40:41 -0400 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2011-04-15 19:40:41 -0400 |
commit | 233e3b4596d0ec5a4d85ac2953d9432c7fd97abf (patch) | |
tree | 2f88fc30ea9bb18189741cae099b96013d6dc9dc | |
parent | 1848a10b5102ee67d58938b81349934663e550e7 (diff) |
Add additional donations
-rw-r--r-- | litmus/sched_edf_hsb.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/litmus/sched_edf_hsb.c b/litmus/sched_edf_hsb.c index 33192be7b6fe..8b544ec36e27 100644 --- a/litmus/sched_edf_hsb.c +++ b/litmus/sched_edf_hsb.c | |||
@@ -970,6 +970,8 @@ static struct task_struct* next_eligible_hrt(hrt_server_t *hrt_server) | |||
970 | /* The server missed the shift to no slack */ | 970 | /* The server missed the shift to no slack */ |
971 | hrt_server->no_slack = 1; | 971 | hrt_server->no_slack = 1; |
972 | sched_trace_action(NULL, 3); | 972 | sched_trace_action(NULL, 3); |
973 | } else if (!hrtimer_active(&hrt_server->slack_timer)) { | ||
974 | slack_timer_arm(hrt_server); | ||
973 | } | 975 | } |
974 | 976 | ||
975 | } else { | 977 | } else { |
@@ -1995,7 +1997,8 @@ static void edf_hsb_task_block(struct task_struct *task) | |||
1995 | { | 1997 | { |
1996 | unsigned long flags; | 1998 | unsigned long flags; |
1997 | cpu_entry_t *entry = task_sched_entry(task); | 1999 | cpu_entry_t *entry = task_sched_entry(task); |
1998 | server_t *linked, *srt; | 2000 | struct task_struct *linked; |
2001 | server_t *linked_server; | ||
1999 | 2002 | ||
2000 | TRACE_TASK(task, "block at %llu\n", litmus_clock()); | 2003 | TRACE_TASK(task, "block at %llu\n", litmus_clock()); |
2001 | 2004 | ||
@@ -2003,13 +2006,13 @@ static void edf_hsb_task_block(struct task_struct *task) | |||
2003 | 2006 | ||
2004 | set_rt_flags(task, RT_F_BLOCK); | 2007 | set_rt_flags(task, RT_F_BLOCK); |
2005 | 2008 | ||
2006 | linked = entry->linked_server; | 2009 | linked = entry->linked; |
2007 | srt = task_srt_server(task); | 2010 | linked_server = entry->linked_server; |
2008 | 2011 | ||
2009 | unlink(task); | 2012 | unlink(task); |
2010 | 2013 | ||
2011 | if (is_srt(task) && srt == linked) { | 2014 | if (task == linked) { |
2012 | check_donate_slack(task_srt_server(task), task); | 2015 | check_donate_slack(linked_server, task); |
2013 | } | 2016 | } |
2014 | 2017 | ||
2015 | raw_spin_unlock_irqrestore(global_lock, flags); | 2018 | raw_spin_unlock_irqrestore(global_lock, flags); |
@@ -2051,7 +2054,7 @@ static void edf_hsb_task_exit(struct task_struct *task) | |||
2051 | static struct task_struct* edf_hsb_schedule(struct task_struct *prev) | 2054 | static struct task_struct* edf_hsb_schedule(struct task_struct *prev) |
2052 | { | 2055 | { |
2053 | unsigned long flags; | 2056 | unsigned long flags; |
2054 | int blocks, preempted, sleep, was_slack; | 2057 | int blocks, preempted, sleep, was_slack, np; |
2055 | struct task_struct *curr; | 2058 | struct task_struct *curr; |
2056 | cpu_entry_t *entry = local_cpu_entry; | 2059 | cpu_entry_t *entry = local_cpu_entry; |
2057 | 2060 | ||
@@ -2087,9 +2090,10 @@ static struct task_struct* edf_hsb_schedule(struct task_struct *prev) | |||
2087 | preempted = entry->scheduled != entry->linked; | 2090 | preempted = entry->scheduled != entry->linked; |
2088 | sleep = curr && get_rt_flags(curr) == RT_F_SLEEP; | 2091 | sleep = curr && get_rt_flags(curr) == RT_F_SLEEP; |
2089 | was_slack = !list_empty(&slack_queue); | 2092 | was_slack = !list_empty(&slack_queue); |
2093 | np = curr && is_np(curr); | ||
2090 | 2094 | ||
2091 | TRACE("blocks: %d, preempted: %d, sleep: %d\n", | 2095 | TRACE("blocks: %d, preempted: %d, sleep: %d, np: %d\n", |
2092 | blocks, preempted, sleep); | 2096 | blocks, preempted, sleep, np); |
2093 | if (blocks) | 2097 | if (blocks) |
2094 | unlink(entry->scheduled); | 2098 | unlink(entry->scheduled); |
2095 | 2099 | ||