aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/percpu-rwsem.h
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2012-11-27 22:59:52 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-11-28 10:33:50 -0500
commit4b05a1c74d1cfae37cf6ff293ee928350f031418 (patch)
tree1b5c9507f5622fbf1affe4fc4e07ed0b60c3413e /include/linux/percpu-rwsem.h
parente23739b4ade80a3a7f87198f008f6c44a7cbc9fd (diff)
percpu-rwsem: use synchronize_sched_expedited
Use synchronize_sched_expedited() instead of synchronize_sched() to improve mount speed. This patch improves mount time from 0.500s to 0.013s for Jeff's test-case. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Reported-and-tested-by: Jeff Chua <jeff.chua.linux@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/percpu-rwsem.h')
-rw-r--r--include/linux/percpu-rwsem.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/percpu-rwsem.h b/include/linux/percpu-rwsem.h
index 250a4acddb2b..bd1e86071e57 100644
--- a/include/linux/percpu-rwsem.h
+++ b/include/linux/percpu-rwsem.h
@@ -13,7 +13,7 @@ struct percpu_rw_semaphore {
13}; 13};
14 14
15#define light_mb() barrier() 15#define light_mb() barrier()
16#define heavy_mb() synchronize_sched() 16#define heavy_mb() synchronize_sched_expedited()
17 17
18static inline void percpu_down_read(struct percpu_rw_semaphore *p) 18static inline void percpu_down_read(struct percpu_rw_semaphore *p)
19{ 19{
@@ -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_sched(); /* make sure that all readers exit the rcu_read_lock_sched region */ 54 synchronize_sched_expedited(); /* 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 */