Commit 87047afa authored by Thomas Gleixner's avatar Thomas Gleixner

sched: convert cpupri_vec lock to atomic_spinlock

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent aadc06f2
...@@ -119,27 +119,27 @@ void cpupri_set(struct cpupri *cp, int cpu, int newpri) ...@@ -119,27 +119,27 @@ void cpupri_set(struct cpupri *cp, int cpu, int newpri)
if (likely(oldpri != CPUPRI_INVALID)) { if (likely(oldpri != CPUPRI_INVALID)) {
struct cpupri_vec *vec = &cp->pri_to_cpu[oldpri]; struct cpupri_vec *vec = &cp->pri_to_cpu[oldpri];
spin_lock_irqsave(&vec->lock, flags); atomic_spin_lock_irqsave(&vec->lock, flags);
vec->count--; vec->count--;
if (!vec->count) if (!vec->count)
clear_bit(oldpri, cp->pri_active); clear_bit(oldpri, cp->pri_active);
cpumask_clear_cpu(cpu, vec->mask); cpumask_clear_cpu(cpu, vec->mask);
spin_unlock_irqrestore(&vec->lock, flags); atomic_spin_unlock_irqrestore(&vec->lock, flags);
} }
if (likely(newpri != CPUPRI_INVALID)) { if (likely(newpri != CPUPRI_INVALID)) {
struct cpupri_vec *vec = &cp->pri_to_cpu[newpri]; struct cpupri_vec *vec = &cp->pri_to_cpu[newpri];
spin_lock_irqsave(&vec->lock, flags); atomic_spin_lock_irqsave(&vec->lock, flags);
cpumask_set_cpu(cpu, vec->mask); cpumask_set_cpu(cpu, vec->mask);
vec->count++; vec->count++;
if (vec->count == 1) if (vec->count == 1)
set_bit(newpri, cp->pri_active); set_bit(newpri, cp->pri_active);
spin_unlock_irqrestore(&vec->lock, flags); atomic_spin_unlock_irqrestore(&vec->lock, flags);
} }
*currpri = newpri; *currpri = newpri;
...@@ -165,7 +165,7 @@ int cpupri_init(struct cpupri *cp, bool bootmem) ...@@ -165,7 +165,7 @@ int cpupri_init(struct cpupri *cp, bool bootmem)
for (i = 0; i < CPUPRI_NR_PRIORITIES; i++) { for (i = 0; i < CPUPRI_NR_PRIORITIES; i++) {
struct cpupri_vec *vec = &cp->pri_to_cpu[i]; struct cpupri_vec *vec = &cp->pri_to_cpu[i];
spin_lock_init(&vec->lock); atomic_spin_lock_init(&vec->lock);
vec->count = 0; vec->count = 0;
if (!zalloc_cpumask_var(&vec->mask, gfp)) if (!zalloc_cpumask_var(&vec->mask, gfp))
goto cleanup; goto cleanup;
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
/* values 2-101 are RT priorities 0-99 */ /* values 2-101 are RT priorities 0-99 */
struct cpupri_vec { struct cpupri_vec {
spinlock_t lock; atomic_spinlock_t lock;
int count; int count;
cpumask_var_t mask; cpumask_var_t mask;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment