The patch titled srcu-3: improved comment and code-style improvements from Joe Perches has been removed from the -mm tree. Its filename is srcu-3-rcu-variant-permitting-read-side-blocking-fix.patch This patch was dropped because it was folded into srcu-3-rcu-variant-permitting-read-side-blocking.patch ------------------------------------------------------ Subject: srcu-3: improved comment and code-style improvements from Joe Perches From: "Paul E. McKenney" <paulmck@xxxxxxxxxx> An improved comment for synchronize_srcu() and fixes for code-style bugs pointed out by off-list by Joe Perches. Cc: Joe Perches <joe@xxxxxxxxxxx> Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- kernel/srcu.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff -puN kernel/srcu.c~srcu-3-rcu-variant-permitting-read-side-blocking-fix kernel/srcu.c --- a/kernel/srcu.c~srcu-3-rcu-variant-permitting-read-side-blocking-fix +++ a/kernel/srcu.c @@ -62,7 +62,7 @@ static int srcu_readers_active_idx(struc sum = 0; for_each_possible_cpu(cpu) sum += per_cpu_ptr(sp->per_cpu_ref, cpu)->c[idx]; - return (sum); + return sum; } /** @@ -144,11 +144,15 @@ void srcu_read_unlock(struct srcu_struct * As with classic RCU, the updater must use some separate means of * synchronizing concurrent updates. Can block; must be called from * process context. + * + * Note that it is illegal to call synchornize_srcu() from the corresponding + * SRCU read-side critical section; doing so will result in deadlock. + * However, it is perfectly legal to call synchronize_srcu() on one + * srcu_struct from some other srcu_struct's read-side critical section. */ void synchronize_srcu(struct srcu_struct *sp) { int idx; - int sum; idx = sp->completed; mutex_lock(&sp->mutex); @@ -195,12 +199,8 @@ void synchronize_srcu(struct srcu_struct * will have finished executing. */ - for (;;) { - sum = srcu_readers_active_idx(sp, idx); - if (sum == 0) - break; + while (srcu_readers_active_idx(sp, idx)) schedule_timeout_interruptible(1); - } synchronize_sched(); /* Force memory barrier on all CPUs. */ _ Patches currently in -mm which might be from paulmck@xxxxxxxxxx are origin.patch srcu-3-rcu-variant-permitting-read-side-blocking.patch srcu-3-rcu-variant-permitting-read-side-blocking-fix.patch srcu-3-rcu-variant-permitting-read-side-blocking-srcu-add-lock-annotations.patch srcu-3-rcu-variant-permitting-read-side-blocking-comments.patch srcu-3-add-srcu-operations-to-rcutorture.patch srcu-3-add-srcu-operations-to-rcutorture-fix.patch add-srcu-based-notifier-chains.patch add-srcu-based-notifier-chains-cleanup.patch srcu-report-out-of-memory-errors.patch srcu-report-out-of-memory-errors-fixlet.patch cpufreq-make-the-transition_notifier-chain-use-srcu.patch rcu-add-module_author-to-rcutorture-module.patch rcu-mention-rcu_bh-in-description-of-rcutortures.patch rcu-avoid-kthread_stop-on-invalid-pointer-if-rcutorture.patch rcu-fix-sign-bug-making-rcu_random-always-return-the-same.patch rcu-add-fake-writers-to-rcutorture.patch rcu-add-fake-writers-to-rcutorture-tidy.patch rcu-refactor-srcu_torture_deferred_free-to-work-for.patch rcu-add-rcu_sync-torture-type-to-rcutorture.patch rcu-add-rcu_bh_sync-torture-type-to-rcutorture.patch rcu-add-sched-torture-type-to-rcutorture.patch rcu-simplify-improve-batch-tuning.patch rcu-credits-and-maintainers.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html