aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2013-01-08 18:19:43 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2013-01-08 18:24:50 -0500
commit642eadd6b82daaeeb3247c2417bf58d113639a1c (patch)
tree8307cb63230f46e814eb8161656bf5d1fb3614e0
parentfa1229f9776c7ecc99baa187e0b485ebdbfdd78c (diff)
Extend non-rt support to sync-releases.
Note that non-rt tasks are released immediately. That is, the 'delay' provided to the release_ts() system-call is ignored for non-rt tasks.
-rw-r--r--litmus/sync.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/litmus/sync.c b/litmus/sync.c
index bf75fde5450b..9fb6366f002f 100644
--- a/litmus/sync.c
+++ b/litmus/sync.c
@@ -65,7 +65,11 @@ static long do_release_ts(lt_t start)
65 struct __wait_queue, 65 struct __wait_queue,
66 task_list)->private; 66 task_list)->private;
67 task_count++; 67 task_count++;
68 litmus->release_at(t, start + t->rt_param.task_params.phase); 68 /* RT tasks can be delayed. Non-RT tasks are released
69 immediately. */
70 if (is_realtime(t)) {
71 litmus->release_at(t, start + t->rt_param.task_params.phase);
72 }
69 sched_trace_task_release(t); 73 sched_trace_task_release(t);
70 } 74 }
71 75
@@ -80,10 +84,8 @@ static long do_release_ts(lt_t start)
80asmlinkage long sys_wait_for_ts_release(void) 84asmlinkage long sys_wait_for_ts_release(void)
81{ 85{
82 long ret = -EPERM; 86 long ret = -EPERM;
83 struct task_struct *t = current;
84 87
85 if (is_realtime(t)) 88 ret = do_wait_for_ts_release();
86 ret = do_wait_for_ts_release();
87 89
88 return ret; 90 return ret;
89} 91}
@@ -97,8 +99,11 @@ asmlinkage long sys_release_ts(lt_t __user *__delay)
97 /* FIXME: check capabilities... */ 99 /* FIXME: check capabilities... */
98 100
99 ret = copy_from_user(&delay, __delay, sizeof(delay)); 101 ret = copy_from_user(&delay, __delay, sizeof(delay));
100 if (ret == 0) 102 if (ret == 0) {
103 /* Note: Non-rt tasks that participate in a sync release cannot be
104 delayed. They will be released immediately. */
101 ret = do_release_ts(litmus_clock() + delay); 105 ret = do_release_ts(litmus_clock() + delay);
106 }
102 107
103 return ret; 108 return ret;
104} 109}