<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/kernel/rcu, branch v4.4.183</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.4.183</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.4.183'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2019-06-11T10:24:04Z</updated>
<entry>
<title>rcutorture: Fix cleanup path for invalid torture_type strings</title>
<updated>2019-06-11T10:24:04Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.ibm.com</email>
</author>
<published>2019-03-21T16:27:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1909121a6192008911974c259b7e87f89d8782ef'/>
<id>urn:sha1:1909121a6192008911974c259b7e87f89d8782ef</id>
<content type='text'>
[ Upstream commit b813afae7ab6a5e91b4e16cc567331d9c2ae1f04 ]

If the specified rcutorture.torture_type is not in the rcu_torture_init()
function's torture_ops[] array, rcutorture prints some console messages
and then invokes rcu_torture_cleanup() to set state so that a future
torture test can run.  However, rcu_torture_cleanup() also attempts to
end the test that didn't actually start, and in doing so relies on the
value of cur_ops, a value that is not particularly relevant in this case.
This can result in confusing output or even follow-on failures due to
attempts to use facilities that have not been properly initialized.

This commit therefore sets the value of cur_ops to NULL in this case
and inserts a check near the beginning of rcu_torture_cleanup(),
thus avoiding relying on an irrelevant cur_ops value.

Reported-by: kernel test robot &lt;rong.a.chen@intel.com&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.ibm.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>rcu: Do RCU GP kthread self-wakeup from softirq and interrupt</title>
<updated>2019-03-23T07:44:39Z</updated>
<author>
<name>Zhang, Jun</name>
<email>jun.zhang@intel.com</email>
</author>
<published>2018-12-18T14:55:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=25c4c4519352b57c8fc02d7e1a2ff2c4407c1171'/>
<id>urn:sha1:25c4c4519352b57c8fc02d7e1a2ff2c4407c1171</id>
<content type='text'>
commit 1d1f898df6586c5ea9aeaf349f13089c6fa37903 upstream.

The rcu_gp_kthread_wake() function is invoked when it might be necessary
to wake the RCU grace-period kthread.  Because self-wakeups are normally
a useless waste of CPU cycles, if rcu_gp_kthread_wake() is invoked from
this kthread, it naturally refuses to do the wakeup.

Unfortunately, natural though it might be, this heuristic fails when
rcu_gp_kthread_wake() is invoked from an interrupt or softirq handler
that interrupted the grace-period kthread just after the final check of
the wait-event condition but just before the schedule() call.  In this
case, a wakeup is required, even though the call to rcu_gp_kthread_wake()
is within the RCU grace-period kthread's context.  Failing to provide
this wakeup can result in grace periods failing to start, which in turn
results in out-of-memory conditions.

This race window is quite narrow, but it actually did happen during real
testing.  It would of course need to be fixed even if it was strictly
theoretical in nature.

This patch does not Cc stable because it does not apply cleanly to
earlier kernel versions.

Fixes: 48a7639ce80c ("rcu: Make callers awaken grace-period kthread")
Reported-by: "He, Bo" &lt;bo.he@intel.com&gt;
Co-developed-by: "Zhang, Jun" &lt;jun.zhang@intel.com&gt;
Co-developed-by: "He, Bo" &lt;bo.he@intel.com&gt;
Co-developed-by: "xiao, jin" &lt;jin.xiao@intel.com&gt;
Co-developed-by: Bai, Jie A &lt;jie.a.bai@intel.com&gt;
Signed-off: "Zhang, Jun" &lt;jun.zhang@intel.com&gt;
Signed-off: "He, Bo" &lt;bo.he@intel.com&gt;
Signed-off: "xiao, jin" &lt;jin.xiao@intel.com&gt;
Signed-off: Bai, Jie A &lt;jie.a.bai@intel.com&gt;
Signed-off-by: "Zhang, Jun" &lt;jun.zhang@intel.com&gt;
[ paulmck: Switch from !in_softirq() to "!in_interrupt() &amp;&amp;
  !in_serving_softirq() to avoid redundant wakeups and to also handle the
  interrupt-handler scenario as well as the softirq-handler scenario that
  actually occurred in testing. ]
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.ibm.com&gt;
Link: https://lkml.kernel.org/r/CD6925E8781EFD4D8E11882D20FC406D52A11F61@SHSMSX104.ccr.corp.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;


</content>
</entry>
<entry>
<title>rcu: Force boolean subscript for expedited stall warnings</title>
<updated>2019-02-08T10:25:33Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.vnet.ibm.com</email>
</author>
<published>2016-01-12T00:29:29Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=60c7f8fca1bbc6ac677a76f25843202b91f52abb'/>
<id>urn:sha1:60c7f8fca1bbc6ac677a76f25843202b91f52abb</id>
<content type='text'>
commit ec3833ed02ae6ef2a933ece9de7cbab0c64c699e upstream.

The cpu_online() function can return values other than 0 and 1, which
can result in subscript overflow when applied to a two-element array.
This commit allows for this behavior by using "!!" on the return value
from cpu_online() when used as a subscript.

Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Cc: "Rantala, Tommi" &lt;tommi.t.rantala@nokia.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>rcu: Allow for page faults in NMI handlers</title>
<updated>2017-10-18T07:20:41Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.vnet.ibm.com</email>
</author>
<published>2017-09-22T21:10:22Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5fd45516595ac995b859ab817031bb004542d446'/>
<id>urn:sha1:5fd45516595ac995b859ab817031bb004542d446</id>
<content type='text'>
commit 28585a832602747cbfa88ad8934013177a3aae38 upstream.

A number of architecture invoke rcu_irq_enter() on exception entry in
order to allow RCU read-side critical sections in the exception handler
when the exception is from an idle or nohz_full CPU.  This works, at
least unless the exception happens in an NMI handler.  In that case,
rcu_nmi_enter() would already have exited the extended quiescent state,
which would mean that rcu_irq_enter() would (incorrectly) cause RCU
to think that it is again in an extended quiescent state.  This will
in turn result in lockdep splats in response to later RCU read-side
critical sections.

This commit therefore causes rcu_irq_enter() and rcu_irq_exit() to
take no action if there is an rcu_nmi_enter() in effect, thus avoiding
the unscheduled return to RCU quiescent state.  This in turn should
make the kernel safe for on-demand RCU voyeurism.

Link: http://lkml.kernel.org/r/20170922211022.GA18084@linux.vnet.ibm.com

Cc: stable@vger.kernel.org
Fixes: 0be964be0 ("module: Sanitize RCU usage and locking")
Reported-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>rcu: Fix soft lockup for rcu_nocb_kthread</title>
<updated>2016-12-08T06:15:24Z</updated>
<author>
<name>Ding Tianhong</name>
<email>dingtianhong@huawei.com</email>
</author>
<published>2016-06-15T07:27:36Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=dfb704f96cd190239e7b86b09810a136cf25506e'/>
<id>urn:sha1:dfb704f96cd190239e7b86b09810a136cf25506e</id>
<content type='text'>
commit bedc1969150d480c462cdac320fa944b694a7162 upstream.

Carrying out the following steps results in a softlockup in the
RCU callback-offload (rcuo) kthreads:

1. Connect to ixgbevf, and set the speed to 10Gb/s.
2. Use ifconfig to bring the nic up and down repeatedly.

[  317.005148] IPv6: ADDRCONF(NETDEV_CHANGE): eth2: link becomes ready
[  368.106005] BUG: soft lockup - CPU#1 stuck for 22s! [rcuos/1:15]
[  368.106005] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
[  368.106005] task: ffff88057dd8a220 ti: ffff88057dd9c000 task.ti: ffff88057dd9c000
[  368.106005] RIP: 0010:[&lt;ffffffff81579e04&gt;]  [&lt;ffffffff81579e04&gt;] fib_table_lookup+0x14/0x390
[  368.106005] RSP: 0018:ffff88061fc83ce8  EFLAGS: 00000286
[  368.106005] RAX: 0000000000000001 RBX: 00000000020155c0 RCX: 0000000000000001
[  368.106005] RDX: ffff88061fc83d50 RSI: ffff88061fc83d70 RDI: ffff880036d11a00
[  368.106005] RBP: ffff88061fc83d08 R08: 0000000000000001 R09: 0000000000000000
[  368.106005] R10: ffff880036d11a00 R11: ffffffff819e0900 R12: ffff88061fc83c58
[  368.106005] R13: ffffffff816154dd R14: ffff88061fc83d08 R15: 00000000020155c0
[  368.106005] FS:  0000000000000000(0000) GS:ffff88061fc80000(0000) knlGS:0000000000000000
[  368.106005] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  368.106005] CR2: 00007f8c2aee9c40 CR3: 000000057b222000 CR4: 00000000000407e0
[  368.106005] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  368.106005] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[  368.106005] Stack:
[  368.106005]  00000000010000c0 ffff88057b766000 ffff8802e380b000 ffff88057af03e00
[  368.106005]  ffff88061fc83dc0 ffffffff815349a6 ffff88061fc83d40 ffffffff814ee146
[  368.106005]  ffff8802e380af00 00000000e380af00 ffffffff819e0900 020155c0010000c0
[  368.106005] Call Trace:
[  368.106005]  &lt;IRQ&gt;
[  368.106005]
[  368.106005]  [&lt;ffffffff815349a6&gt;] ip_route_input_noref+0x516/0xbd0
[  368.106005]  [&lt;ffffffff814ee146&gt;] ? skb_release_data+0xd6/0x110
[  368.106005]  [&lt;ffffffff814ee20a&gt;] ? kfree_skb+0x3a/0xa0
[  368.106005]  [&lt;ffffffff8153698f&gt;] ip_rcv_finish+0x29f/0x350
[  368.106005]  [&lt;ffffffff81537034&gt;] ip_rcv+0x234/0x380
[  368.106005]  [&lt;ffffffff814fd656&gt;] __netif_receive_skb_core+0x676/0x870
[  368.106005]  [&lt;ffffffff814fd868&gt;] __netif_receive_skb+0x18/0x60
[  368.106005]  [&lt;ffffffff814fe4de&gt;] process_backlog+0xae/0x180
[  368.106005]  [&lt;ffffffff814fdcb2&gt;] net_rx_action+0x152/0x240
[  368.106005]  [&lt;ffffffff81077b3f&gt;] __do_softirq+0xef/0x280
[  368.106005]  [&lt;ffffffff8161619c&gt;] call_softirq+0x1c/0x30
[  368.106005]  &lt;EOI&gt;
[  368.106005]
[  368.106005]  [&lt;ffffffff81015d95&gt;] do_softirq+0x65/0xa0
[  368.106005]  [&lt;ffffffff81077174&gt;] local_bh_enable+0x94/0xa0
[  368.106005]  [&lt;ffffffff81114922&gt;] rcu_nocb_kthread+0x232/0x370
[  368.106005]  [&lt;ffffffff81098250&gt;] ? wake_up_bit+0x30/0x30
[  368.106005]  [&lt;ffffffff811146f0&gt;] ? rcu_start_gp+0x40/0x40
[  368.106005]  [&lt;ffffffff8109728f&gt;] kthread+0xcf/0xe0
[  368.106005]  [&lt;ffffffff810971c0&gt;] ? kthread_create_on_node+0x140/0x140
[  368.106005]  [&lt;ffffffff816147d8&gt;] ret_from_fork+0x58/0x90
[  368.106005]  [&lt;ffffffff810971c0&gt;] ? kthread_create_on_node+0x140/0x140

==================================cut here==============================

It turns out that the rcuos callback-offload kthread is busy processing
a very large quantity of RCU callbacks, and it is not reliquishing the
CPU while doing so.  This commit therefore adds an cond_resched_rcu_qs()
within the loop to allow other tasks to run.

Signed-off-by: Ding Tianhong &lt;dingtianhong@huawei.com&gt;
[ paulmck: Substituted cond_resched_rcu_qs for cond_resched. ]
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Cc: Dhaval Giani &lt;dhaval.giani@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Merge branches 'doc.2015.10.06a', 'percpu-rwsem.2015.10.06a' and 'torture.2015.10.06a' into HEAD</title>
<updated>2015-10-07T23:06:25Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.vnet.ibm.com</email>
</author>
<published>2015-10-07T23:06:25Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=39cd2dd39a8b92ce91c4dad95f6e979c946a3942'/>
<id>urn:sha1:39cd2dd39a8b92ce91c4dad95f6e979c946a3942</id>
<content type='text'>
doc.2015.10.06a:  Documentation updates.
percpu-rwsem.2015.10.06a:  Optimization of per-CPU reader-writer semaphores.
torture.2015.10.06a:  Torture-test updates.
</content>
</entry>
<entry>
<title>Merge branches 'fixes.2015.10.06a' and 'exp.2015.10.07a' into HEAD</title>
<updated>2015-10-07T23:05:21Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.vnet.ibm.com</email>
</author>
<published>2015-10-07T23:05:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d2856b046d2ce2bfb664727cb8671ad0e371bd6c'/>
<id>urn:sha1:d2856b046d2ce2bfb664727cb8671ad0e371bd6c</id>
<content type='text'>
exp.2015.10.07a:  Reduce OS jitter of RCU-sched expedited grace periods.
fixes.2015.10.06a:  Miscellaneous fixes.
</content>
</entry>
<entry>
<title>rcu: Better hotplug handling for synchronize_sched_expedited()</title>
<updated>2015-10-07T23:02:50Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.vnet.ibm.com</email>
</author>
<published>2015-09-03T07:45:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=338b0f760e84676130c6e4d8268cb8c923b38c8c'/>
<id>urn:sha1:338b0f760e84676130c6e4d8268cb8c923b38c8c</id>
<content type='text'>
Earlier versions of synchronize_sched_expedited() can prematurely end
grace periods due to the fact that a CPU marked as cpu_is_offline()
can still be using RCU read-side critical sections during the time that
CPU makes its last pass through the scheduler and into the idle loop
and during the time that a given CPU is in the process of coming online.
This commit therefore eliminates this window by adding additional
interaction with the CPU-hotplug operations.

Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>rcu: Enable stall warnings for synchronize_rcu_expedited()</title>
<updated>2015-10-07T23:02:50Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.vnet.ibm.com</email>
</author>
<published>2015-08-18T19:17:29Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b08517c76d764c373c232cd309ed058c98705219'/>
<id>urn:sha1:b08517c76d764c373c232cd309ed058c98705219</id>
<content type='text'>
This commit redirects synchronize_rcu_expedited()'s wait to
synchronize_sched_expedited_wait(), thus enabling RCU CPU
stall warnings.

Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>rcu: Add tasks to expedited stall-warning messages</title>
<updated>2015-10-07T23:02:50Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.vnet.ibm.com</email>
</author>
<published>2015-08-18T18:25:48Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c58656382e5f2919b05913584f2c54b4f841bc9f'/>
<id>urn:sha1:c58656382e5f2919b05913584f2c54b4f841bc9f</id>
<content type='text'>
This commit adds task-print ability to the expedited RCU CPU stall
warning messages in preparation for adding stall warnings to
synchornize_rcu_expedited().

Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
</content>
</entry>
</feed>
