<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/rcu, branch v5.5</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.5</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.5'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2019-10-30T15:47:13Z</updated>
<entry>
<title>Merge branches 'doc.2019.10.29a', 'fixes.2019.10.30a', 'nohz.2019.10.28a', 'replace.2019.10.30a', 'torture.2019.10.05a' and 'lkmm.2019.10.05a' into HEAD</title>
<updated>2019-10-30T15:47:13Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@kernel.org</email>
</author>
<published>2019-10-30T15:47:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8dcdfb7096a304130ab36fbb0f2961deaf863e5a'/>
<id>urn:sha1:8dcdfb7096a304130ab36fbb0f2961deaf863e5a</id>
<content type='text'>
doc.2019.10.29a: RCU documentation updates.
fixes.2019.10.30a: RCU miscellaneous fixes.
nohz.2019.10.28a: RCU NO_HZ and NO_HZ_FULL updates.
replace.2019.10.30a: Replace rcu_swap_protected() with rcu_replace().
torture.2019.10.05a: RCU torture-test updates.

lkmm.2019.10.05a: Linux kernel memory model updates.
</content>
</entry>
<entry>
<title>rcu: Suppress levelspread uninitialized messages</title>
<updated>2019-10-30T15:34:53Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@kernel.org</email>
</author>
<published>2019-09-18T17:10:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=36b5dae64513b7ce3a0e0f6cb469e0f74bacad45'/>
<id>urn:sha1:36b5dae64513b7ce3a0e0f6cb469e0f74bacad45</id>
<content type='text'>
New tools bring new warnings, and with v5.3 comes:

kernel/rcu/srcutree.c: warning: 'levelspread[&lt;U aa0&gt;]' may be used uninitialized in this function [-Wuninitialized]:  =&gt; 121:34

This commit suppresses this warning by initializing the full array
to INT_MIN, which will result in failures should any out-of-bounds
references appear.

Reported-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Reported-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
Reviewed-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
</content>
</entry>
<entry>
<title>rcu: Fix uninitialized variable in nocb_gp_wait()</title>
<updated>2019-10-30T15:34:53Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2019-09-23T14:26:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b8889c9c89a2655a231dfed93cc9bdca0930ea67'/>
<id>urn:sha1:b8889c9c89a2655a231dfed93cc9bdca0930ea67</id>
<content type='text'>
We never set this to false.  This probably doesn't affect most people's
runtime because GCC will automatically initialize it to false at certain
common optimization levels.  But that behavior is related to a bug in
GCC and obviously should not be relied on.

Fixes: 5d6742b37727 ("rcu/nocb: Use rcu_segcblist for no-CBs CPUs")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
</content>
</entry>
<entry>
<title>rcu: Ensure that -&gt;rcu_urgent_qs is set before resched IPI</title>
<updated>2019-10-30T15:34:35Z</updated>
<author>
<name>Joel Fernandes (Google)</name>
<email>joel@joelfernandes.org</email>
</author>
<published>2019-08-16T02:59:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=05ef9e9eb3dade21413680f41eb0170778e8ae2b'/>
<id>urn:sha1:05ef9e9eb3dade21413680f41eb0170778e8ae2b</id>
<content type='text'>
The RCU-specific resched_cpu() function sends a resched IPI to the
specified CPU, which can be used to force the tick on for a given
nohz_full CPU.  This is needed when this nohz_full CPU is looping in the
kernel while blocking the current grace period.  However, for the tick
to actually be forced on in all cases, that CPU's rcu_data structure's
-&gt;rcu_urgent_qs flag must be set beforehand.  This commit therefore
causes rcu_implicit_dynticks_qs() to set this flag prior to invoking
resched_cpu() on a holdout nohz_full CPU.

Signed-off-by: Joel Fernandes (Google) &lt;joel@joelfernandes.org&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
</content>
</entry>
<entry>
<title>rcu: Several rcu_segcblist functions can be static</title>
<updated>2019-10-30T15:33:22Z</updated>
<author>
<name>kbuild test robot</name>
<email>lkp@intel.com</email>
</author>
<published>2019-08-08T02:32:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1d24dd4e01fb6b928cf679e3e415ddff7016fa96'/>
<id>urn:sha1:1d24dd4e01fb6b928cf679e3e415ddff7016fa96</id>
<content type='text'>
None of rcu_segcblist_set_len(), rcu_segcblist_add_len(), or
rcu_segcblist_xchg_len() are used outside of kernel/rcu/rcu_segcblist.c.
This commit therefore makes them static.

Fixes: eda669a6a2c5 ("rcu/nocb: Atomic -&gt;len field in rcu_segcblist structure")
Signed-off-by: kbuild test robot &lt;lkp@intel.com&gt;
[ paulmck: "Fixes:" updated per Stephen Rothwell feedback. ]
Signed-off-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
</content>
</entry>
<entry>
<title>rcu: Make kernel-mode nohz_full CPUs invoke the RCU core processing</title>
<updated>2019-10-28T14:02:21Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@kernel.org</email>
</author>
<published>2019-09-14T10:39:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=dd7dafd1ad50aa9ed7958235431f243ea131ee7d'/>
<id>urn:sha1:dd7dafd1ad50aa9ed7958235431f243ea131ee7d</id>
<content type='text'>
If a nohz_full CPU is idle or executing in userspace, it makes good sense
to keep it out of RCU core processing.  After all, the RCU grace-period
kthread can see its quiescent states and all of its callbacks are
offloaded, so there is nothing for RCU core processing to do.

However, if a nohz_full CPU is executing in kernel space, the RCU
grace-period kthread cannot do anything for it, so such a CPU must report
its own quiescent states.  This commit therefore makes nohz_full CPUs
skip RCU core processing only if the scheduler-clock interrupt caught
them in idle or in userspace.

Signed-off-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
</content>
</entry>
<entry>
<title>rcu: Confine -&gt;core_needs_qs accesses to the corresponding CPU</title>
<updated>2019-10-28T14:02:21Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@kernel.org</email>
</author>
<published>2019-09-13T21:09:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ed93dfc6bc0084485ccad1ff6bd2ea81ab2c03cd'/>
<id>urn:sha1:ed93dfc6bc0084485ccad1ff6bd2ea81ab2c03cd</id>
<content type='text'>
Commit 671a63517cf9 ("rcu: Avoid unnecessary softirq when system
is idle") fixed a bug that could result in an indefinite number of
unnecessary invocations of the RCU_SOFTIRQ handler at the trailing edge
of a scheduler-clock interrupt.  However, the fix introduced off-CPU
stores to -&gt;core_needs_qs.  These writes did not conflict with the
on-CPU stores because the CPU's leaf rcu_node structure's -&gt;lock was
held across all such stores.  However, the loads from -&gt;core_needs_qs
were not promoted to READ_ONCE() and, worse yet, the code loading from
-&gt;core_needs_qs was written assuming that it was only ever updated by
the corresponding CPU.  So operation has been robust, but only by luck.
This situation is therefore an accident waiting to happen.

This commit therefore takes a different approach.  Instead of clearing
-&gt;core_needs_qs from the grace-period kthread's force-quiescent-state
processing, it modifies the rcu_pending() function to suppress the
rcu_sched_clock_irq() function's call to invoke_rcu_core() if there is no
grace period in progress.  This avoids the infinite needless RCU_SOFTIRQ
handlers while still keeping all accesses to -&gt;core_needs_qs local to
the corresponding CPU.

Signed-off-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
</content>
</entry>
<entry>
<title>rcu: Reset CPU hints when reporting a quiescent state</title>
<updated>2019-10-28T14:02:21Z</updated>
<author>
<name>Joel Fernandes (Google)</name>
<email>joel@joelfernandes.org</email>
</author>
<published>2019-09-05T17:26:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=516e5ae0c94016294d3ef175454215b235d03945'/>
<id>urn:sha1:516e5ae0c94016294d3ef175454215b235d03945</id>
<content type='text'>
In some cases, tracing shows that need_heavy_qs is still set even though
urgent_qs was cleared upon reporting of a quiescent state.  One such
case is when the softirq reports that a CPU has passed quiescent state.

Commit 671a63517cf9 ("rcu: Avoid unnecessary softirq when system is
idle") fixed a bug where core_needs_qs was not being cleared.  In order
to avoid running into similar situations with the urgent-grace-period
flags, this commit causes rcu_disable_urgency_upon_qs(), previously
rcu_disable_tick_upon_qs(), to clear the urgency hints, -&gt;rcu_urgent_qs
and -&gt;rcu_need_heavy_qs.  Note that it is possible for CPUs to go
offline with these urgency hints still set.  This is handled because
rcu_disable_urgency_upon_qs() is also invoked during the online process.

Because these hints can be cleared both by the corresponding CPU and by
the grace-period kthread, this commit also adds a number of READ_ONCE()
and WRITE_ONCE() calls.

Tested overnight with rcutorture running for 60 minutes on all
configurations of RCU.

Signed-off-by: "Joel Fernandes (Google)" &lt;joel@joelfernandes.org&gt;
[ paulmck: Clear urgency flags in rcu_disable_urgency_upon_qs(). ]
[ paulmck: Remove -&gt;core_needs_qs from the set cleared at quiescent state. ]
[ paulmck: Make rcu_disable_urgency_upon_qs static per kbuild test robot. ]
Signed-off-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
</content>
</entry>
<entry>
<title>rcu: Force nohz_full tick on upon irq enter instead of exit</title>
<updated>2019-10-28T14:02:21Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@kernel.org</email>
</author>
<published>2019-08-15T20:24:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b200a0489517d9e5a52e983183e890f573454ebd'/>
<id>urn:sha1:b200a0489517d9e5a52e983183e890f573454ebd</id>
<content type='text'>
There is interrupt-exit code that forces on the tick for nohz_full CPUs
failing to respond to the current grace period in a timely fashion.
However, this code must compare -&gt;dynticks_nmi_nesting to the value 2
in the interrupt-exit fastpath.  This commit therefore moves this code
to the interrupt-entry fastpath, where a lighter-weight comparison to
zero may be used.

Reported-by: Joel Fernandes &lt;joel@joelfernandes.org&gt;
[ paulmck: Apply Joel Fernandes TICK_DEP_MASK_RCU-&gt;TICK_DEP_BIT_RCU fix. ]
Signed-off-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
</content>
</entry>
<entry>
<title>rcu: Force tick on for nohz_full CPUs not reaching quiescent states</title>
<updated>2019-10-28T14:02:21Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@kernel.org</email>
</author>
<published>2019-08-12T23:14:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=66e4c33b51bc515ca803c0948cf1525b53ffd631'/>
<id>urn:sha1:66e4c33b51bc515ca803c0948cf1525b53ffd631</id>
<content type='text'>
CPUs running for long time periods in the kernel in nohz_full mode
might leave the scheduling-clock interrupt disabled for then full
duration of their in-kernel execution.  This can (among other things)
delay grace periods.  This commit therefore forces the tick back on
for any nohz_full CPU that is failing to pass through a quiescent state
upon return from interrupt, which the resched_cpu() will induce.

Reported-by: Joel Fernandes &lt;joel@joelfernandes.org&gt;
[ paulmck: Clear -&gt;rcu_forced_tick as reported by Joel Fernandes testing. ]
[ paulmck: Apply Joel Fernandes TICK_DEP_MASK_RCU-&gt;TICK_DEP_BIT_RCU fix. ]
Signed-off-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
</content>
</entry>
</feed>
