<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/git/stable/linux.git/Documentation/RCU/trace.txt, branch master</title>
<subtitle>Linux kernel stable tree</subtitle>
<id>https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/atom?h=master</id>
<link rel='self' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/'/>
<updated>2017-06-09T01:52:43+00:00</updated>
<entry>
<title>rcu: Remove debugfs tracing</title>
<updated>2017-06-09T01:52:43+00:00</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.vnet.ibm.com</email>
</author>
<published>2017-05-15T22:30:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=ae91aa0adb14dc33114d566feca2f7cb7a96b8b7'/>
<id>urn:sha1:ae91aa0adb14dc33114d566feca2f7cb7a96b8b7</id>
<content type='text'>
RCU's debugfs tracing used to be the only reasonable low-level debug
information available, but ftrace and event tracing has since surpassed
the RCU debugfs level of usefulness.  This commit therefore removes
RCU's debugfs tracing.

Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>rcu: Eliminate unused expedited_normal counter</title>
<updated>2017-01-23T19:37:14+00:00</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.vnet.ibm.com</email>
</author>
<published>2017-01-07T06:04:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=bb4e2c08bbfa8eb032db7814f6100086aac102d3'/>
<id>urn:sha1:bb4e2c08bbfa8eb032db7814f6100086aac102d3</id>
<content type='text'>
Expedited grace periods no longer fall back to normal grace periods
in response to lock contention, given that expedited grace periods
now use the rcu_node tree so as to avoid contention.  This commit
therfore removes the expedited_normal counter.

Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Reviewed-by: Josh Triplett &lt;josh@joshtriplett.org&gt;
</content>
</entry>
<entry>
<title>rcu: Remove expedited GP funnel-lock bypass</title>
<updated>2016-03-31T20:34:07+00:00</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.vnet.ibm.com</email>
</author>
<published>2016-01-31T01:23:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=e2fd9d35847d1936398d44c4df68dceb3d7f64e7'/>
<id>urn:sha1:e2fd9d35847d1936398d44c4df68dceb3d7f64e7</id>
<content type='text'>
Commit #cdacbe1f91264 ("rcu: Add fastpath bypassing funnel locking")
turns out to be a pessimization at high load because it forces a tree
full of tasks to wait for an expedited grace period that they probably
do not need.  This commit therefore removes this optimization.

Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>rcu: Invert passed_quiesce and rename to cpu_no_qs</title>
<updated>2015-09-21T04:16:21+00:00</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.vnet.ibm.com</email>
</author>
<published>2015-08-06T21:17:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=0d43eb34f9aabcddf41c99b7af2d0ced33e9a3cc'/>
<id>urn:sha1:0d43eb34f9aabcddf41c99b7af2d0ced33e9a3cc</id>
<content type='text'>
This commit inverts the sense of the rcu_data structure's -&gt;passed_quiesce
field and renames it to -&gt;cpu_no_qs.  This will allow a later commit to
use an "aggregate OR" operation to test expedited as well as normal grace
periods without added overhead.

Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>rcu: Add fastpath bypassing funnel locking</title>
<updated>2015-07-17T21:59:06+00:00</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.vnet.ibm.com</email>
</author>
<published>2015-07-11T23:24:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=cdacbe1f91264687af956e810278030f2ab5a3d0'/>
<id>urn:sha1:cdacbe1f91264687af956e810278030f2ab5a3d0</id>
<content type='text'>
In the common case, there will be only one expedited grace period in
the system at a given time, in which case it is not helpful to use
funnel locking.  This commit therefore adds a fastpath that bypasses
funnel locking when the root -&gt;exp_funnel_mutex is not held.

Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>rcu: Make cond_resched_rcu_qs() apply to normal RCU flavors</title>
<updated>2015-01-16T07:33:14+00:00</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.vnet.ibm.com</email>
</author>
<published>2014-12-14T04:32:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=5cd37193ce8539be1e6ef76be226f4bcc984e0f5'/>
<id>urn:sha1:5cd37193ce8539be1e6ef76be226f4bcc984e0f5</id>
<content type='text'>
Although cond_resched_rcu_qs() only applies to TASKS_RCU, it is used
in places where it would be useful for it to apply to the normal RCU
flavors, rcu_preempt, rcu_sched, and rcu_bh.  This is especially the
case for workloads that aggressively overload the system, particularly
those that generate large numbers of RCU updates on systems running
NO_HZ_FULL CPUs.  This commit therefore communicates quiescent states
from cond_resched_rcu_qs() to the normal RCU flavors.

Note that it is unfortunately necessary to leave the old -&gt;passed_quiesce
mechanism in place to allow quiescent states that apply to only one
flavor to be recorded.  (Yes, we could decrement -&gt;rcu_qs_ctr_snap in
that case, but that is not so good for debugging of RCU internals.)
In addition, if one of the RCU flavor's grace period has stalled, this
will invoke rcu_momentary_dyntick_idle(), resulting in a heavy-weight
quiescent state visible from other CPUs.

Reported-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
Reported-by: Dave Jones &lt;davej@redhat.com&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
[ paulmck: Merge commit from Sasha Levin fixing a bug where __this_cpu()
  was used in preemptible code. ]
</content>
</entry>
<entry>
<title>rcu: Remove redundant TREE_PREEMPT_RCU config option</title>
<updated>2014-10-29T17:20:05+00:00</updated>
<author>
<name>Pranith Kumar</name>
<email>bobby.prani@gmail.com</email>
</author>
<published>2014-09-22T18:00:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=28f6569ab7d036cd4ee94c26bb76dc1b3f3fc056'/>
<id>urn:sha1:28f6569ab7d036cd4ee94c26bb76dc1b3f3fc056</id>
<content type='text'>
PREEMPT_RCU and TREE_PREEMPT_RCU serve the same function after
TINY_PREEMPT_RCU has been removed. This patch removes TREE_PREEMPT_RCU
and uses PREEMPT_RCU config option in its place.

Signed-off-by: Pranith Kumar &lt;bobby.prani@gmail.com&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>Merge branches 'doc.2013.12.03a', 'fixes.2013.12.12a', 'rcutorture.2013.12.03a' and 'sparse.2013.12.12a' into HEAD</title>
<updated>2013-12-12T20:35:38+00:00</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.vnet.ibm.com</email>
</author>
<published>2013-12-12T20:35:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=0d3c55bc9fd58393bd3bd9974991ec1f815e1326'/>
<id>urn:sha1:0d3c55bc9fd58393bd3bd9974991ec1f815e1326</id>
<content type='text'>
doc.2013.12.03a: Topic branch for documentation changes.
fixes.2013.12.12a: Topic branch for miscellaneous fixes.
rcutorture.2013.12.03a: Topic branch for new rcutorture/KVM scripting.
sparse.2013.12.12a: Topic branch for sparse-RCU changes.
</content>
</entry>
<entry>
<title>rcu: Break call_rcu() deadlock involving scheduler and perf</title>
<updated>2013-12-03T18:10:18+00:00</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.vnet.ibm.com</email>
</author>
<published>2013-10-04T21:33:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=96d3fd0d315a949e30adc80f086031c5cdf070d1'/>
<id>urn:sha1:96d3fd0d315a949e30adc80f086031c5cdf070d1</id>
<content type='text'>
Dave Jones got the following lockdep splat:

&gt;  ======================================================
&gt;  [ INFO: possible circular locking dependency detected ]
&gt;  3.12.0-rc3+ #92 Not tainted
&gt;  -------------------------------------------------------
&gt;  trinity-child2/15191 is trying to acquire lock:
&gt;   (&amp;rdp-&gt;nocb_wq){......}, at: [&lt;ffffffff8108ff43&gt;] __wake_up+0x23/0x50
&gt;
&gt; but task is already holding lock:
&gt;   (&amp;ctx-&gt;lock){-.-...}, at: [&lt;ffffffff81154c19&gt;] perf_event_exit_task+0x109/0x230
&gt;
&gt; which lock already depends on the new lock.
&gt;
&gt;
&gt; the existing dependency chain (in reverse order) is:
&gt;
&gt; -&gt; #3 (&amp;ctx-&gt;lock){-.-...}:
&gt;         [&lt;ffffffff810cc243&gt;] lock_acquire+0x93/0x200
&gt;         [&lt;ffffffff81733f90&gt;] _raw_spin_lock+0x40/0x80
&gt;         [&lt;ffffffff811500ff&gt;] __perf_event_task_sched_out+0x2df/0x5e0
&gt;         [&lt;ffffffff81091b83&gt;] perf_event_task_sched_out+0x93/0xa0
&gt;         [&lt;ffffffff81732052&gt;] __schedule+0x1d2/0xa20
&gt;         [&lt;ffffffff81732f30&gt;] preempt_schedule_irq+0x50/0xb0
&gt;         [&lt;ffffffff817352b6&gt;] retint_kernel+0x26/0x30
&gt;         [&lt;ffffffff813eed04&gt;] tty_flip_buffer_push+0x34/0x50
&gt;         [&lt;ffffffff813f0504&gt;] pty_write+0x54/0x60
&gt;         [&lt;ffffffff813e900d&gt;] n_tty_write+0x32d/0x4e0
&gt;         [&lt;ffffffff813e5838&gt;] tty_write+0x158/0x2d0
&gt;         [&lt;ffffffff811c4850&gt;] vfs_write+0xc0/0x1f0
&gt;         [&lt;ffffffff811c52cc&gt;] SyS_write+0x4c/0xa0
&gt;         [&lt;ffffffff8173d4e4&gt;] tracesys+0xdd/0xe2
&gt;
&gt; -&gt; #2 (&amp;rq-&gt;lock){-.-.-.}:
&gt;         [&lt;ffffffff810cc243&gt;] lock_acquire+0x93/0x200
&gt;         [&lt;ffffffff81733f90&gt;] _raw_spin_lock+0x40/0x80
&gt;         [&lt;ffffffff810980b2&gt;] wake_up_new_task+0xc2/0x2e0
&gt;         [&lt;ffffffff81054336&gt;] do_fork+0x126/0x460
&gt;         [&lt;ffffffff81054696&gt;] kernel_thread+0x26/0x30
&gt;         [&lt;ffffffff8171ff93&gt;] rest_init+0x23/0x140
&gt;         [&lt;ffffffff81ee1e4b&gt;] start_kernel+0x3f6/0x403
&gt;         [&lt;ffffffff81ee1571&gt;] x86_64_start_reservations+0x2a/0x2c
&gt;         [&lt;ffffffff81ee1664&gt;] x86_64_start_kernel+0xf1/0xf4
&gt;
&gt; -&gt; #1 (&amp;p-&gt;pi_lock){-.-.-.}:
&gt;         [&lt;ffffffff810cc243&gt;] lock_acquire+0x93/0x200
&gt;         [&lt;ffffffff8173419b&gt;] _raw_spin_lock_irqsave+0x4b/0x90
&gt;         [&lt;ffffffff810979d1&gt;] try_to_wake_up+0x31/0x350
&gt;         [&lt;ffffffff81097d62&gt;] default_wake_function+0x12/0x20
&gt;         [&lt;ffffffff81084af8&gt;] autoremove_wake_function+0x18/0x40
&gt;         [&lt;ffffffff8108ea38&gt;] __wake_up_common+0x58/0x90
&gt;         [&lt;ffffffff8108ff59&gt;] __wake_up+0x39/0x50
&gt;         [&lt;ffffffff8110d4f8&gt;] __call_rcu_nocb_enqueue+0xa8/0xc0
&gt;         [&lt;ffffffff81111450&gt;] __call_rcu+0x140/0x820
&gt;         [&lt;ffffffff81111b8d&gt;] call_rcu+0x1d/0x20
&gt;         [&lt;ffffffff81093697&gt;] cpu_attach_domain+0x287/0x360
&gt;         [&lt;ffffffff81099d7e&gt;] build_sched_domains+0xe5e/0x10a0
&gt;         [&lt;ffffffff81efa7fc&gt;] sched_init_smp+0x3b7/0x47a
&gt;         [&lt;ffffffff81ee1f4e&gt;] kernel_init_freeable+0xf6/0x202
&gt;         [&lt;ffffffff817200be&gt;] kernel_init+0xe/0x190
&gt;         [&lt;ffffffff8173d22c&gt;] ret_from_fork+0x7c/0xb0
&gt;
&gt; -&gt; #0 (&amp;rdp-&gt;nocb_wq){......}:
&gt;         [&lt;ffffffff810cb7ca&gt;] __lock_acquire+0x191a/0x1be0
&gt;         [&lt;ffffffff810cc243&gt;] lock_acquire+0x93/0x200
&gt;         [&lt;ffffffff8173419b&gt;] _raw_spin_lock_irqsave+0x4b/0x90
&gt;         [&lt;ffffffff8108ff43&gt;] __wake_up+0x23/0x50
&gt;         [&lt;ffffffff8110d4f8&gt;] __call_rcu_nocb_enqueue+0xa8/0xc0
&gt;         [&lt;ffffffff81111450&gt;] __call_rcu+0x140/0x820
&gt;         [&lt;ffffffff81111bb0&gt;] kfree_call_rcu+0x20/0x30
&gt;         [&lt;ffffffff81149abf&gt;] put_ctx+0x4f/0x70
&gt;         [&lt;ffffffff81154c3e&gt;] perf_event_exit_task+0x12e/0x230
&gt;         [&lt;ffffffff81056b8d&gt;] do_exit+0x30d/0xcc0
&gt;         [&lt;ffffffff8105893c&gt;] do_group_exit+0x4c/0xc0
&gt;         [&lt;ffffffff810589c4&gt;] SyS_exit_group+0x14/0x20
&gt;         [&lt;ffffffff8173d4e4&gt;] tracesys+0xdd/0xe2
&gt;
&gt; other info that might help us debug this:
&gt;
&gt; Chain exists of:
&gt;   &amp;rdp-&gt;nocb_wq --&gt; &amp;rq-&gt;lock --&gt; &amp;ctx-&gt;lock
&gt;
&gt;   Possible unsafe locking scenario:
&gt;
&gt;         CPU0                    CPU1
&gt;         ----                    ----
&gt;    lock(&amp;ctx-&gt;lock);
&gt;                                 lock(&amp;rq-&gt;lock);
&gt;                                 lock(&amp;ctx-&gt;lock);
&gt;    lock(&amp;rdp-&gt;nocb_wq);
&gt;
&gt;  *** DEADLOCK ***
&gt;
&gt; 1 lock held by trinity-child2/15191:
&gt;  #0:  (&amp;ctx-&gt;lock){-.-...}, at: [&lt;ffffffff81154c19&gt;] perf_event_exit_task+0x109/0x230
&gt;
&gt; stack backtrace:
&gt; CPU: 2 PID: 15191 Comm: trinity-child2 Not tainted 3.12.0-rc3+ #92
&gt;  ffffffff82565b70 ffff880070c2dbf8 ffffffff8172a363 ffffffff824edf40
&gt;  ffff880070c2dc38 ffffffff81726741 ffff880070c2dc90 ffff88022383b1c0
&gt;  ffff88022383aac0 0000000000000000 ffff88022383b188 ffff88022383b1c0
&gt; Call Trace:
&gt;  [&lt;ffffffff8172a363&gt;] dump_stack+0x4e/0x82
&gt;  [&lt;ffffffff81726741&gt;] print_circular_bug+0x200/0x20f
&gt;  [&lt;ffffffff810cb7ca&gt;] __lock_acquire+0x191a/0x1be0
&gt;  [&lt;ffffffff810c6439&gt;] ? get_lock_stats+0x19/0x60
&gt;  [&lt;ffffffff8100b2f4&gt;] ? native_sched_clock+0x24/0x80
&gt;  [&lt;ffffffff810cc243&gt;] lock_acquire+0x93/0x200
&gt;  [&lt;ffffffff8108ff43&gt;] ? __wake_up+0x23/0x50
&gt;  [&lt;ffffffff8173419b&gt;] _raw_spin_lock_irqsave+0x4b/0x90
&gt;  [&lt;ffffffff8108ff43&gt;] ? __wake_up+0x23/0x50
&gt;  [&lt;ffffffff8108ff43&gt;] __wake_up+0x23/0x50
&gt;  [&lt;ffffffff8110d4f8&gt;] __call_rcu_nocb_enqueue+0xa8/0xc0
&gt;  [&lt;ffffffff81111450&gt;] __call_rcu+0x140/0x820
&gt;  [&lt;ffffffff8109bc8f&gt;] ? local_clock+0x3f/0x50
&gt;  [&lt;ffffffff81111bb0&gt;] kfree_call_rcu+0x20/0x30
&gt;  [&lt;ffffffff81149abf&gt;] put_ctx+0x4f/0x70
&gt;  [&lt;ffffffff81154c3e&gt;] perf_event_exit_task+0x12e/0x230
&gt;  [&lt;ffffffff81056b8d&gt;] do_exit+0x30d/0xcc0
&gt;  [&lt;ffffffff810c9af5&gt;] ? trace_hardirqs_on_caller+0x115/0x1e0
&gt;  [&lt;ffffffff810c9bcd&gt;] ? trace_hardirqs_on+0xd/0x10
&gt;  [&lt;ffffffff8105893c&gt;] do_group_exit+0x4c/0xc0
&gt;  [&lt;ffffffff810589c4&gt;] SyS_exit_group+0x14/0x20
&gt;  [&lt;ffffffff8173d4e4&gt;] tracesys+0xdd/0xe2

The underlying problem is that perf is invoking call_rcu() with the
scheduler locks held, but in NOCB mode, call_rcu() will with high
probability invoke the scheduler -- which just might want to use its
locks.  The reason that call_rcu() needs to invoke the scheduler is
to wake up the corresponding rcuo callback-offload kthread, which
does the job of starting up a grace period and invoking the callbacks
afterwards.

One solution (championed on a related problem by Lai Jiangshan) is to
simply defer the wakeup to some point where scheduler locks are no longer
held.  Since we don't want to unnecessarily incur the cost of such
deferral, the task before us is threefold:

1.	Determine when it is likely that a relevant scheduler lock is held.

2.	Defer the wakeup in such cases.

3.	Ensure that all deferred wakeups eventually happen, preferably
	sooner rather than later.

We use irqs_disabled_flags() as a proxy for relevant scheduler locks
being held.  This works because the relevant locks are always acquired
with interrupts disabled.  We may defer more often than needed, but that
is at least safe.

The wakeup deferral is tracked via a new field in the per-CPU and
per-RCU-flavor rcu_data structure, namely -&gt;nocb_defer_wakeup.

This flag is checked by the RCU core processing.  The __rcu_pending()
function now checks this flag, which causes rcu_check_callbacks()
to initiate RCU core processing at each scheduling-clock interrupt
where this flag is set.  Of course this is not sufficient because
scheduling-clock interrupts are often turned off (the things we used to
be able to count on!).  So the flags are also checked on entry to any
state that RCU considers to be idle, which includes both NO_HZ_IDLE idle
state and NO_HZ_FULL user-mode-execution state.

This approach should allow call_rcu() to be invoked regardless of what
locks you might be holding, the key word being "should".

Reported-by: Dave Jones &lt;davej@redhat.com&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
</content>
</entry>
<entry>
<title>rcu: Fix typo in Documentation/RCU/trace.txt</title>
<updated>2013-12-03T18:08:56+00:00</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.vnet.ibm.com</email>
</author>
<published>2013-10-09T21:34:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=c9592ecb98d1e6d6ab2b54895314a46abfa69db4'/>
<id>urn:sha1:c9592ecb98d1e6d6ab2b54895314a46abfa69db4</id>
<content type='text'>
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
</content>
</entry>
</feed>
