Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158335
b: refs/heads/master
c: c3a2ae3
h: refs/heads/master
i:
  158333: ec78e82
  158331: 47907a6
  158327: 2b24aff
  158319: c7461e1
  158303: 0809c0f
  158271: da7a602
  158207: 09c818f
v: v3
  • Loading branch information
Steven Rostedt authored and Ingo Molnar committed Aug 2, 2009
1 parent e3d5815 commit 5d36b2e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 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: da19ab510343c6496fe8b8f890091296032025c9
refs/heads/master: c3a2ae3d93c0f10d29c071f599764d00b8de00cb
30 changes: 16 additions & 14 deletions trunk/kernel/sched_cpupri.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,21 +127,11 @@ void cpupri_set(struct cpupri *cp, int cpu, int newpri)

/*
* If the cpu was currently mapped to a different value, we
* first need to unmap the old value
* need to map it to the new value then remove the old value.
* Note, we must add the new value first, otherwise we risk the
* cpu being cleared from pri_active, and this cpu could be
* missed for a push or pull.
*/
if (likely(oldpri != CPUPRI_INVALID)) {
struct cpupri_vec *vec = &cp->pri_to_cpu[oldpri];

spin_lock_irqsave(&vec->lock, flags);

vec->count--;
if (!vec->count)
clear_bit(oldpri, cp->pri_active);
cpumask_clear_cpu(cpu, vec->mask);

spin_unlock_irqrestore(&vec->lock, flags);
}

if (likely(newpri != CPUPRI_INVALID)) {
struct cpupri_vec *vec = &cp->pri_to_cpu[newpri];

Expand All @@ -154,6 +144,18 @@ void cpupri_set(struct cpupri *cp, int cpu, int newpri)

spin_unlock_irqrestore(&vec->lock, flags);
}
if (likely(oldpri != CPUPRI_INVALID)) {
struct cpupri_vec *vec = &cp->pri_to_cpu[oldpri];

spin_lock_irqsave(&vec->lock, flags);

vec->count--;
if (!vec->count)
clear_bit(oldpri, cp->pri_active);
cpumask_clear_cpu(cpu, vec->mask);

spin_unlock_irqrestore(&vec->lock, flags);
}

*currpri = newpri;
}
Expand Down

0 comments on commit 5d36b2e

Please sign in to comment.