runtime: prevent empty spinning kthreads from starving RCU
@@ -262,11 +262,16 @@ again:
goto done;
/* finally try to steal from every kthread */
- for (i = 0; i < last_nrks; i++) {
- if (ks[i] == l)
- continue;
- if (steal_work(l, ks[i]))
+ for (i = 0; i < last_nrks; i++)
+ if (ks[i] != l && steal_work(l, ks[i]))
goto done;
+
+ /* check for RCU reclamation */
+ if (unlikely(load_acquire(&rcu_gen) != l->rcu_gen)) {
+ spin_unlock(&l->lock);
+ __rcu_recurrent(l);
+ spin_lock(&l->lock);
+ goto again;
}
/* keep trying to find work until the polling timeout expires */
