The patch titled srcu comments has been added to the -mm tree. Its filename is srcu-3-rcu-variant-permitting-read-side-blocking-comments.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: srcu comments From: "Paul E. McKenney" <paulmck@xxxxxxxxxx> Add verbiage to an existing comment. Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- kernel/srcu.c | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+) diff -puN kernel/srcu.c~srcu-3-rcu-variant-permitting-read-side-blocking-comments kernel/srcu.c --- a/kernel/srcu.c~srcu-3-rcu-variant-permitting-read-side-blocking-comments +++ a/kernel/srcu.c @@ -211,6 +211,25 @@ void synchronize_srcu(struct srcu_struct * More importantly, it also forces the corresponding SRCU read-side * critical sections to have also completed, and the corresponding * references to SRCU-protected data items to be dropped. + * + * Note: + * + * Despite what you might think at first glance, the + * preceding synchronize_sched() -must- be within the + * critical section ended by the following mutex_unlock(). + * Otherwise, a task taking the early exit can race + * with a srcu_read_unlock(), which might have executed + * just before the preceding srcu_readers_active() check, + * and whose CPU might have reordered the srcu_read_unlock() + * with the preceding critical section. In this case, there + * is nothing preventing the synchronize_sched() task that is + * taking the early exit from freeing a data structure that + * is still being referenced (out of order) by the task + * doing the srcu_read_unlock(). + * + * Alternatively, the comparison with "2" on the early exit + * could be changed to "3", but this increases synchronize_srcu() + * latency for bulk loads. So the current code is preferred. */ mutex_unlock(&sp->mutex); _ Patches currently in -mm which might be from paulmck@xxxxxxxxxx are radix-tree-rcu-lockless-readside.patch adix-tree-rcu-lockless-readside-update.patch rcu-add-lock-annotations-to-rcu_bh_torture_read_lockunlock.patch memory-ordering-in-__kfifo-primitives.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-fix-incorrect-description-of-default-for-rcutorture.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 - 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