diff options
| -rw-r--r-- | include/linux/percpu-rwsem.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/percpu-rwsem.h b/include/linux/percpu-rwsem.h index 18f35b54286c..250a4acddb2b 100644 --- a/include/linux/percpu-rwsem.h +++ b/include/linux/percpu-rwsem.h | |||
| @@ -17,16 +17,16 @@ struct percpu_rw_semaphore { | |||
| 17 | 17 | ||
| 18 | static inline void percpu_down_read(struct percpu_rw_semaphore *p) | 18 | static inline void percpu_down_read(struct percpu_rw_semaphore *p) |
| 19 | { | 19 | { |
| 20 | rcu_read_lock(); | 20 | rcu_read_lock_sched(); |
| 21 | if (unlikely(p->locked)) { | 21 | if (unlikely(p->locked)) { |
| 22 | rcu_read_unlock(); | 22 | rcu_read_unlock_sched(); |
| 23 | mutex_lock(&p->mtx); | 23 | mutex_lock(&p->mtx); |
| 24 | this_cpu_inc(*p->counters); | 24 | this_cpu_inc(*p->counters); |
| 25 | mutex_unlock(&p->mtx); | 25 | mutex_unlock(&p->mtx); |
| 26 | return; | 26 | return; |
| 27 | } | 27 | } |
| 28 | this_cpu_inc(*p->counters); | 28 | this_cpu_inc(*p->counters); |
| 29 | rcu_read_unlock(); | 29 | rcu_read_unlock_sched(); |
| 30 | light_mb(); /* A, between read of p->locked and read of data, paired with D */ | 30 | light_mb(); /* A, between read of p->locked and read of data, paired with D */ |
| 31 | } | 31 | } |
| 32 | 32 | ||
| @@ -51,7 +51,7 @@ static inline void percpu_down_write(struct percpu_rw_semaphore *p) | |||
| 51 | { | 51 | { |
| 52 | mutex_lock(&p->mtx); | 52 | mutex_lock(&p->mtx); |
| 53 | p->locked = true; | 53 | p->locked = true; |
| 54 | synchronize_rcu(); | 54 | synchronize_sched(); /* make sure that all readers exit the rcu_read_lock_sched region */ |
| 55 | while (__percpu_count(p->counters)) | 55 | while (__percpu_count(p->counters)) |
| 56 | msleep(1); | 56 | msleep(1); |
| 57 | heavy_mb(); /* C, between read of p->counter and write to data, paired with B */ | 57 | heavy_mb(); /* C, between read of p->counter and write to data, paired with B */ |
