Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Mikulas Patocka and committed by
Linus Torvalds
4b05a1c7 e23739b4

+2 -2
+2 -2
include/linux/percpu-rwsem.h
··· 13 13 }; 14 14 15 15 #define light_mb() barrier() 16 - #define heavy_mb() synchronize_sched() 16 + #define heavy_mb() synchronize_sched_expedited() 17 17 18 18 static inline void percpu_down_read(struct percpu_rw_semaphore *p) 19 19 { ··· 51 51 { 52 52 mutex_lock(&p->mtx); 53 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 55 while (__percpu_count(p->counters)) 56 56 msleep(1); 57 57 heavy_mb(); /* C, between read of p->counter and write to data, paired with B */