diff options
author | David S. Miller <davem@davemloft.net> | 2009-09-11 23:35:13 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-09-11 23:35:13 -0400 |
commit | cabc5c0f7fa1342049042d6e147db5a73773955b (patch) | |
tree | 2be09ae1777d580c7dfe05d6d5b76e57281ec447 /kernel/sched_cpupri.c | |
parent | b73d884756303316ead4cd7dad51236b2a515a1a (diff) | |
parent | 86d710146fb9975f04c505ec78caa43d227c1018 (diff) |
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Conflicts:
arch/sparc/Kconfig
Diffstat (limited to 'kernel/sched_cpupri.c')
-rw-r--r-- | kernel/sched_cpupri.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/kernel/sched_cpupri.c b/kernel/sched_cpupri.c index d014efbf947a..0f052fc674d5 100644 --- a/kernel/sched_cpupri.c +++ b/kernel/sched_cpupri.c | |||
@@ -127,21 +127,11 @@ void cpupri_set(struct cpupri *cp, int cpu, int newpri) | |||
127 | 127 | ||
128 | /* | 128 | /* |
129 | * If the cpu was currently mapped to a different value, we | 129 | * If the cpu was currently mapped to a different value, we |
130 | * first need to unmap the old value | 130 | * need to map it to the new value then remove the old value. |
131 | * Note, we must add the new value first, otherwise we risk the | ||
132 | * cpu being cleared from pri_active, and this cpu could be | ||
133 | * missed for a push or pull. | ||
131 | */ | 134 | */ |
132 | if (likely(oldpri != CPUPRI_INVALID)) { | ||
133 | struct cpupri_vec *vec = &cp->pri_to_cpu[oldpri]; | ||
134 | |||
135 | spin_lock_irqsave(&vec->lock, flags); | ||
136 | |||
137 | vec->count--; | ||
138 | if (!vec->count) | ||
139 | clear_bit(oldpri, cp->pri_active); | ||
140 | cpumask_clear_cpu(cpu, vec->mask); | ||
141 | |||
142 | spin_unlock_irqrestore(&vec->lock, flags); | ||
143 | } | ||
144 | |||
145 | if (likely(newpri != CPUPRI_INVALID)) { | 135 | if (likely(newpri != CPUPRI_INVALID)) { |
146 | struct cpupri_vec *vec = &cp->pri_to_cpu[newpri]; | 136 | struct cpupri_vec *vec = &cp->pri_to_cpu[newpri]; |
147 | 137 | ||
@@ -154,6 +144,18 @@ void cpupri_set(struct cpupri *cp, int cpu, int newpri) | |||
154 | 144 | ||
155 | spin_unlock_irqrestore(&vec->lock, flags); | 145 | spin_unlock_irqrestore(&vec->lock, flags); |
156 | } | 146 | } |
147 | if (likely(oldpri != CPUPRI_INVALID)) { | ||
148 | struct cpupri_vec *vec = &cp->pri_to_cpu[oldpri]; | ||
149 | |||
150 | spin_lock_irqsave(&vec->lock, flags); | ||
151 | |||
152 | vec->count--; | ||
153 | if (!vec->count) | ||
154 | clear_bit(oldpri, cp->pri_active); | ||
155 | cpumask_clear_cpu(cpu, vec->mask); | ||
156 | |||
157 | spin_unlock_irqrestore(&vec->lock, flags); | ||
158 | } | ||
157 | 159 | ||
158 | *currpri = newpri; | 160 | *currpri = newpri; |
159 | } | 161 | } |