···497497498498 Accept the default if unsure.499499500500-config SRCU_SYNCHRONIZE_DELAY501501- int "Microseconds to delay before waiting for readers"502502- range 0 20503503- default 10504504- help505505- This option controls how long SRCU delays before entering its506506- loop waiting on SRCU readers. The purpose of this loop is507507- to avoid the unconditional context-switch penalty that would508508- otherwise be incurred if there was an active SRCU reader,509509- in a manner similar to adaptive locking schemes. This should510510- be set to be a bit longer than the common-case SRCU read-side511511- critical-section overhead.512512-513513- Accept the default if unsure.514514-515500endmenu # "RCU Subsystem"516501517502config IKCONFIG
+2-1
kernel/rcutiny.c
···189189 unsigned long flags;190190191191 for (;;) {192192- wait_event(rcu_kthread_wq, have_rcu_kthread_work != 0);192192+ wait_event_interruptible(rcu_kthread_wq,193193+ have_rcu_kthread_work != 0);193194 morework = rcu_boost();194195 local_irq_save(flags);195196 work = have_rcu_kthread_work;
+13-2
kernel/srcu.c
···156156EXPORT_SYMBOL_GPL(__srcu_read_unlock);157157158158/*159159+ * We use an adaptive strategy for synchronize_srcu() and especially for160160+ * synchronize_srcu_expedited(). We spin for a fixed time period161161+ * (defined below) to allow SRCU readers to exit their read-side critical162162+ * sections. If there are still some readers after 10 microseconds,163163+ * we repeatedly block for 1-millisecond time periods. This approach164164+ * has done well in testing, so there is no need for a config parameter.165165+ */166166+#define SYNCHRONIZE_SRCU_READER_DELAY 10167167+168168+/*159169 * Helper function for synchronize_srcu() and synchronize_srcu_expedited().160170 */161171static void __synchronize_srcu(struct srcu_struct *sp, void (*sync_func)(void))···217207 * will have finished executing. We initially give readers218208 * an arbitrarily chosen 10 microseconds to get out of their219209 * SRCU read-side critical sections, then loop waiting 1/HZ220220- * seconds per iteration.210210+ * seconds per iteration. The 10-microsecond value has done211211+ * very well in testing.221212 */222213223214 if (srcu_readers_active_idx(sp, idx))224224- udelay(CONFIG_SRCU_SYNCHRONIZE_DELAY);215215+ udelay(SYNCHRONIZE_SRCU_READER_DELAY);225216 while (srcu_readers_active_idx(sp, idx))226217 schedule_timeout_interruptible(1);227218