Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 58279
b: refs/heads/master
c: 71f8bd4
h: refs/heads/master
i:
  58277: 415a746
  58275: bd832fc
  58271: fa36a9d
v: v3
  • Loading branch information
Ingo Molnar committed Jul 9, 2007
1 parent 8fb2ee7 commit f593698
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c24d20dbef948487cd14f15dbf04644142e9f886
refs/heads/master: 71f8bd4600521fecb08644072052b85853a5a615
76 changes: 38 additions & 38 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,44 +671,6 @@ static inline void resched_task(struct task_struct *p)

#include "sched_stats.h"

/*
* Adding/removing a task to/from a priority array:
*/
static void dequeue_task(struct task_struct *p, struct prio_array *array)
{
array->nr_active--;
list_del(&p->run_list);
if (list_empty(array->queue + p->prio))
__clear_bit(p->prio, array->bitmap);
}

static void enqueue_task(struct task_struct *p, struct prio_array *array)
{
sched_info_queued(p);
list_add_tail(&p->run_list, array->queue + p->prio);
__set_bit(p->prio, array->bitmap);
array->nr_active++;
p->array = array;
}

/*
* Put task to the end of the run list without the overhead of dequeue
* followed by enqueue.
*/
static void requeue_task(struct task_struct *p, struct prio_array *array)
{
list_move_tail(&p->run_list, array->queue + p->prio);
}

static inline void
enqueue_task_head(struct task_struct *p, struct prio_array *array)
{
list_add(&p->run_list, array->queue + p->prio);
__set_bit(p->prio, array->bitmap);
array->nr_active++;
p->array = array;
}

/*
* __normal_prio - return the priority that is based on the static
* priority but is modified by bonuses/penalties.
Expand Down Expand Up @@ -802,6 +764,44 @@ static inline void dec_nr_running(struct task_struct *p, struct rq *rq)
dec_raw_weighted_load(rq, p);
}

/*
* Adding/removing a task to/from a priority array:
*/
static void dequeue_task(struct task_struct *p, struct prio_array *array)
{
array->nr_active--;
list_del(&p->run_list);
if (list_empty(array->queue + p->prio))
__clear_bit(p->prio, array->bitmap);
}

static void enqueue_task(struct task_struct *p, struct prio_array *array)
{
sched_info_queued(p);
list_add_tail(&p->run_list, array->queue + p->prio);
__set_bit(p->prio, array->bitmap);
array->nr_active++;
p->array = array;
}

/*
* Put task to the end of the run list without the overhead of dequeue
* followed by enqueue.
*/
static void requeue_task(struct task_struct *p, struct prio_array *array)
{
list_move_tail(&p->run_list, array->queue + p->prio);
}

static inline void
enqueue_task_head(struct task_struct *p, struct prio_array *array)
{
list_add(&p->run_list, array->queue + p->prio);
__set_bit(p->prio, array->bitmap);
array->nr_active++;
p->array = array;
}

/*
* Calculate the expected normal priority: i.e. priority
* without taking RT-inheritance into account. Might be
Expand Down

0 comments on commit f593698

Please sign in to comment.