Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 76123
b: refs/heads/master
c: 63489e4
h: refs/heads/master
i:
  76121: e8dbe8b
  76119: 5054723
v: v3
  • Loading branch information
Steven Rostedt authored and Ingo Molnar committed Jan 25, 2008
1 parent 8aa8d70 commit 81f9203
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 82a1fcb90287052aabfa235e7ffc693ea003fe69
refs/heads/master: 63489e45e265f64c368882be1f01c42dec5d984c
1 change: 1 addition & 0 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ struct rt_rq {
struct rt_prio_array active;
int rt_load_balance_idx;
struct list_head *rt_load_balance_head, *rt_load_balance_curr;
unsigned long rt_nr_running;
};

/*
Expand Down
17 changes: 17 additions & 0 deletions trunk/kernel/sched_rt.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,28 @@ static void update_curr_rt(struct rq *rq)
cpuacct_charge(curr, delta_exec);
}

static inline void inc_rt_tasks(struct task_struct *p, struct rq *rq)
{
WARN_ON(!rt_task(p));
rq->rt.rt_nr_running++;
}

static inline void dec_rt_tasks(struct task_struct *p, struct rq *rq)
{
WARN_ON(!rt_task(p));
WARN_ON(!rq->rt.rt_nr_running);
rq->rt.rt_nr_running--;
}

static void enqueue_task_rt(struct rq *rq, struct task_struct *p, int wakeup)
{
struct rt_prio_array *array = &rq->rt.active;

list_add_tail(&p->run_list, array->queue + p->prio);
__set_bit(p->prio, array->bitmap);
inc_cpu_load(rq, p->se.load.weight);

inc_rt_tasks(p, rq);
}

/*
Expand All @@ -48,6 +63,8 @@ static void dequeue_task_rt(struct rq *rq, struct task_struct *p, int sleep)
if (list_empty(array->queue + p->prio))
__clear_bit(p->prio, array->bitmap);
dec_cpu_load(rq, p->se.load.weight);

dec_rt_tasks(p, rq);
}

/*
Expand Down

0 comments on commit 81f9203

Please sign in to comment.