Merge branch 'rcu/next' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-2.6-rcu into core/urgent

+15 -18
-15
init/Kconfig
··· 497 497 498 498 Accept the default if unsure. 499 499 500 - config SRCU_SYNCHRONIZE_DELAY 501 - int "Microseconds to delay before waiting for readers" 502 - range 0 20 503 - default 10 504 - help 505 - This option controls how long SRCU delays before entering its 506 - loop waiting on SRCU readers. The purpose of this loop is 507 - to avoid the unconditional context-switch penalty that would 508 - otherwise be incurred if there was an active SRCU reader, 509 - in a manner similar to adaptive locking schemes. This should 510 - be set to be a bit longer than the common-case SRCU read-side 511 - critical-section overhead. 512 - 513 - Accept the default if unsure. 514 - 515 500 endmenu # "RCU Subsystem" 516 501 517 502 config IKCONFIG
+2 -1
kernel/rcutiny.c
··· 189 189 unsigned long flags; 190 190 191 191 for (;;) { 192 - wait_event(rcu_kthread_wq, have_rcu_kthread_work != 0); 192 + wait_event_interruptible(rcu_kthread_wq, 193 + have_rcu_kthread_work != 0); 193 194 morework = rcu_boost(); 194 195 local_irq_save(flags); 195 196 work = have_rcu_kthread_work;
+13 -2
kernel/srcu.c
··· 156 156 EXPORT_SYMBOL_GPL(__srcu_read_unlock); 157 157 158 158 /* 159 + * We use an adaptive strategy for synchronize_srcu() and especially for 160 + * synchronize_srcu_expedited(). We spin for a fixed time period 161 + * (defined below) to allow SRCU readers to exit their read-side critical 162 + * sections. If there are still some readers after 10 microseconds, 163 + * we repeatedly block for 1-millisecond time periods. This approach 164 + * has done well in testing, so there is no need for a config parameter. 165 + */ 166 + #define SYNCHRONIZE_SRCU_READER_DELAY 10 167 + 168 + /* 159 169 * Helper function for synchronize_srcu() and synchronize_srcu_expedited(). 160 170 */ 161 171 static void __synchronize_srcu(struct srcu_struct *sp, void (*sync_func)(void)) ··· 217 207 * will have finished executing. We initially give readers 218 208 * an arbitrarily chosen 10 microseconds to get out of their 219 209 * SRCU read-side critical sections, then loop waiting 1/HZ 220 - * seconds per iteration. 210 + * seconds per iteration. The 10-microsecond value has done 211 + * very well in testing. 221 212 */ 222 213 223 214 if (srcu_readers_active_idx(sp, idx)) 224 - udelay(CONFIG_SRCU_SYNCHRONIZE_DELAY); 215 + udelay(SYNCHRONIZE_SRCU_READER_DELAY); 225 216 while (srcu_readers_active_idx(sp, idx)) 226 217 schedule_timeout_interruptible(1); 227 218