Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 69119
b: refs/heads/master
c: 3a5e4dc
h: refs/heads/master
i:
  69117: bd8aba1
  69115: 8fea1d3
  69111: 7dbb6b8
  69103: 01e4181
  69087: 79260a9
  69055: 84772f8
  68991: 1b003de
  68863: faf47cd
  68607: 55b50b9
v: v3
  • Loading branch information
Andi Kleen authored and Ingo Molnar committed Oct 15, 2007
1 parent 7f56bf9 commit a8e7981
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 21 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: 8cbbe86dfcfd68ad69916164bdc838d9e09adca8
refs/heads/master: 3a5e4dc12f23fb96fafd4f5d0f61e6c3070f80a5
43 changes: 23 additions & 20 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ unsigned long long __attribute__((weak)) sched_clock(void)
return (unsigned long long)jiffies * (1000000000 / HZ);
}

#ifdef CONFIG_SMP
#define is_migration_thread(p, rq) ((p) == (rq)->migration_thread)
#else
#define is_migration_thread(p, rq) 0
#endif

/*
* Convert user-nice values [ -20 ... 0 ... 19 ]
* to static priority [ MAX_RT_PRIO..MAX_PRIO-1 ],
Expand Down Expand Up @@ -6532,12 +6538,25 @@ EXPORT_SYMBOL(__might_sleep);
#endif

#ifdef CONFIG_MAGIC_SYSRQ
static void normalize_task(struct rq *rq, struct task_struct *p)
{
int on_rq;
update_rq_clock(rq);
on_rq = p->se.on_rq;
if (on_rq)
deactivate_task(rq, p, 0);
__setscheduler(rq, p, SCHED_NORMAL, 0);
if (on_rq) {
activate_task(rq, p, 0);
resched_task(rq->curr);
}
}

void normalize_rt_tasks(void)
{
struct task_struct *g, *p;
unsigned long flags;
struct rq *rq;
int on_rq;

read_lock_irq(&tasklist_lock);
do_each_thread(g, p) {
Expand All @@ -6561,26 +6580,10 @@ void normalize_rt_tasks(void)

spin_lock_irqsave(&p->pi_lock, flags);
rq = __task_rq_lock(p);
#ifdef CONFIG_SMP
/*
* Do not touch the migration thread:
*/
if (p == rq->migration_thread)
goto out_unlock;
#endif

update_rq_clock(rq);
on_rq = p->se.on_rq;
if (on_rq)
deactivate_task(rq, p, 0);
__setscheduler(rq, p, SCHED_NORMAL, 0);
if (on_rq) {
activate_task(rq, p, 0);
resched_task(rq->curr);
}
#ifdef CONFIG_SMP
out_unlock:
#endif
if (!is_migration_thread(p, rq))
normalize_task(rq, p);

__task_rq_unlock(rq);
spin_unlock_irqrestore(&p->pi_lock, flags);
} while_each_thread(g, p);
Expand Down

0 comments on commit a8e7981

Please sign in to comment.