aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2012-10-01 22:02:02 -0400
committerJonathan Herman <hermanjl@cs.unc.edu>2012-10-01 22:02:02 -0400
commit6e515de45f1ad108a8ae08d0be1b6f7bf2a707b6 (patch)
treec622b209aeb03d09564f7a10f4a00f2a1fa09786
parent696ff3d97e631739c21daf15d2f3484ee9b7cb02 (diff)
Create per-task containers only when budget enforcing.
-rw-r--r--litmus/sched_mc.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/litmus/sched_mc.c b/litmus/sched_mc.c
index 2f4eb82b2220..f24c51653fe2 100644
--- a/litmus/sched_mc.c
+++ b/litmus/sched_mc.c
@@ -48,7 +48,6 @@
48 * 48 *
49 * Should BE be moved into the kernel? This will require benchmarking. 49 * Should BE be moved into the kernel? This will require benchmarking.
50 */ 50 */
51
52#include <linux/spinlock.h> 51#include <linux/spinlock.h>
53#include <linux/percpu.h> 52#include <linux/percpu.h>
54#include <linux/sched.h> 53#include <linux/sched.h>
@@ -127,7 +126,6 @@ static int interrupt_cpu;
127static int sid(struct crit_entry *ce) 126static int sid(struct crit_entry *ce)
128{ 127{
129 int level = ce->level * num_online_cpus() + crit_cpu(ce)->cpu + 1; 128 int level = ce->level * num_online_cpus() + crit_cpu(ce)->cpu + 1;
130 BUG_ON(level >= 0);
131 return -level; 129 return -level;
132} 130}
133 131
@@ -852,9 +850,14 @@ static void mc_task_new(struct task_struct *t, int on_rq, int running)
852 entry = &per_cpu(cpus, task_cpu(t)); 850 entry = &per_cpu(cpus, task_cpu(t));
853 t->rt_param._domain = entry->crit_entries[level].domain; 851 t->rt_param._domain = entry->crit_entries[level].domain;
854 852
855 sched_trace_container_param(t->pid, name); 853 if (budget_enforced(t)) {
856 sched_trace_server_param(-t->pid, t->pid, 854 /* Userspace and kernelspace view of task state may differ.
857 get_exec_cost(t), get_rt_period(t)); 855 * Model kernel state as an additional container
856 */
857 sched_trace_container_param(t->pid, name);
858 sched_trace_server_param(-t->pid, t->pid,
859 get_exec_cost(t), get_rt_period(t));
860 }
858 861
859 /* Setup job params */ 862 /* Setup job params */
860 release_at(t, litmus_clock()); 863 release_at(t, litmus_clock());