<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/rcu/tree_plugin.h, 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:34:53Z</updated>
<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/nocb: Don't wake no-CBs GP kthread if timer posted under overload</title>
<updated>2019-08-13T21:38:24Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.ibm.com</email>
</author>
<published>2019-07-16T09:17:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f48fe4c586604c3a09938c6a6e9fd3356dfe8f3c'/>
<id>urn:sha1:f48fe4c586604c3a09938c6a6e9fd3356dfe8f3c</id>
<content type='text'>
When under overload conditions, __call_rcu_nocb_wake() will wake the
no-CBs GP kthread any time the no-CBs CB kthread is asleep or there
are no ready-to-invoke callbacks, but only after a timer delay.  If the
no-CBs GP kthread has a -&gt;nocb_bypass_timer pending, the deferred wakeup
from __call_rcu_nocb_wake() is redundant.  This commit therefore makes
__call_rcu_nocb_wake() avoid posting the redundant deferred wakeup if
-&gt;nocb_bypass_timer is pending.  This requires adding a bit of ordering
of timer actions.

Signed-off-by: Paul E. McKenney &lt;paulmck@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>rcu/nocb: Reduce __call_rcu_nocb_wake() leaf rcu_node -&gt;lock contention</title>
<updated>2019-08-13T21:38:24Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.ibm.com</email>
</author>
<published>2019-07-15T13:06:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=296181d78df9892e08e794f2a9a4d2c38f9acedb'/>
<id>urn:sha1:296181d78df9892e08e794f2a9a4d2c38f9acedb</id>
<content type='text'>
Currently, __call_rcu_nocb_wake() advances callbacks each time that it
detects excessive numbers of callbacks, though only if it succeeds in
conditionally acquiring its leaf rcu_node structure's -&gt;lock.  Despite
the conditional acquisition of -&gt;lock, this does increase contention.
This commit therefore avoids advancing callbacks unless there are
callbacks in -&gt;cblist whose grace period has completed and advancing
has not yet been done during this jiffy.

Note that this decision does not take the presence of new callbacks
into account.  That is because on this code path, there will always be
at least one new callback, namely the one we just enqueued.

Signed-off-by: Paul E. McKenney &lt;paulmck@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>rcu/nocb: Reduce nocb_cb_wait() leaf rcu_node -&gt;lock contention</title>
<updated>2019-08-13T21:38:24Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.ibm.com</email>
</author>
<published>2019-07-15T08:09:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1d5a81c18dc68fc38a52e8dab1992a043a358927'/>
<id>urn:sha1:1d5a81c18dc68fc38a52e8dab1992a043a358927</id>
<content type='text'>
Currently, nocb_cb_wait() advances callbacks on each pass through its
loop, though only if it succeeds in conditionally acquiring its leaf
rcu_node structure's -&gt;lock.  Despite the conditional acquisition of
-&gt;lock, this does increase contention.  This commit therefore avoids
advancing callbacks unless there are callbacks in -&gt;cblist whose grace
period has completed.

Note that nocb_cb_wait() doesn't worry about callbacks that have not
yet been assigned a grace period.  The idea is that the only reason for
nocb_cb_wait() to advance callbacks is to allow it to continue invoking
callbacks.  Time will tell whether this is the correct choice.

Signed-off-by: Paul E. McKenney &lt;paulmck@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>rcu/nocb: Avoid synchronous wakeup in __call_rcu_nocb_wake()</title>
<updated>2019-08-13T21:38:24Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.ibm.com</email>
</author>
<published>2019-07-09T13:54:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=273f034065002bf9480601d66404c991b243b91e'/>
<id>urn:sha1:273f034065002bf9480601d66404c991b243b91e</id>
<content type='text'>
When callbacks are in full flow, the common case is waiting for a
grace period, and this grace period will normally take a few jiffies to
complete.  It therefore isn't all that helpful for __call_rcu_nocb_wake()
to do a synchronous wakeup in this case.  This commit therefore turns this
into a timer-based deferred wakeup of the no-CBs grace-period kthread.

Signed-off-by: Paul E. McKenney &lt;paulmck@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>rcu/nocb: Print no-CBs diagnostics when rcutorture writer unduly delayed</title>
<updated>2019-08-13T21:38:24Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.ibm.com</email>
</author>
<published>2019-06-25T20:32:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f7a81b12d6af42a9d09be1e5f041169f04b0b67a'/>
<id>urn:sha1:f7a81b12d6af42a9d09be1e5f041169f04b0b67a</id>
<content type='text'>
This commit causes locking, sleeping, and callback state to be printed
for no-CBs CPUs when the rcutorture writer is delayed sufficiently for
rcutorture to complain.

Signed-off-by: Paul E. McKenney &lt;paulmck@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>rcu/nocb: EXP Check use and usefulness of -&gt;nocb_lock_contended</title>
<updated>2019-08-13T21:38:24Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.ibm.com</email>
</author>
<published>2019-07-13T19:27:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6aacd88d1721e12b013ae4ccf4f17609bd5091f3'/>
<id>urn:sha1:6aacd88d1721e12b013ae4ccf4f17609bd5091f3</id>
<content type='text'>
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>rcu/nocb: Add bypass callback queueing</title>
<updated>2019-08-13T21:37:32Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.ibm.com</email>
</author>
<published>2019-07-02T23:03:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d1b222c6be1f8bfc77099e034219732ecaeaaf96'/>
<id>urn:sha1:d1b222c6be1f8bfc77099e034219732ecaeaaf96</id>
<content type='text'>
Use of the rcu_data structure's segmented -&gt;cblist for no-CBs CPUs
takes advantage of unrelated grace periods, thus reducing the memory
footprint in the face of floods of call_rcu() invocations.  However,
the -&gt;cblist field is a more-complex rcu_segcblist structure which must
be protected via locking.  Even though there are only three entities
which can acquire this lock (the CPU invoking call_rcu(), the no-CBs
grace-period kthread, and the no-CBs callbacks kthread), the contention
on this lock is excessive under heavy stress.

This commit therefore greatly reduces contention by provisioning
an rcu_cblist structure field named -&gt;nocb_bypass within the
rcu_data structure.  Each no-CBs CPU is permitted only a limited
number of enqueues onto the -&gt;cblist per jiffy, controlled by a new
nocb_nobypass_lim_per_jiffy kernel boot parameter that defaults to
about 16 enqueues per millisecond (16 * 1000 / HZ).  When that limit is
exceeded, the CPU instead enqueues onto the new -&gt;nocb_bypass.

The -&gt;nocb_bypass is flushed into the -&gt;cblist every jiffy or when
the number of callbacks on -&gt;nocb_bypass exceeds qhimark, whichever
happens first.  During call_rcu() floods, this flushing is carried out
by the CPU during the course of its call_rcu() invocations.  However,
a CPU could simply stop invoking call_rcu() at any time.  The no-CBs
grace-period kthread therefore carries out less-aggressive flushing
(every few jiffies or when the number of callbacks on -&gt;nocb_bypass
exceeds (2 * qhimark), whichever comes first).  This means that the
no-CBs grace-period kthread cannot be permitted to do unbounded waits
while there are callbacks on -&gt;nocb_bypass.  A -&gt;nocb_bypass_timer is
used to provide the needed wakeups.

[ paulmck: Apply Coverity feedback reported by Colin Ian King. ]
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>rcu/nocb: Unconditionally advance and wake for excessive CBs</title>
<updated>2019-08-13T21:35:49Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.ibm.com</email>
</author>
<published>2019-06-26T16:50:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=faca5c250935262f026cac1bb951a0f7672474b8'/>
<id>urn:sha1:faca5c250935262f026cac1bb951a0f7672474b8</id>
<content type='text'>
When there are excessive numbers of callbacks, and when either the
corresponding no-CBs callback kthread is asleep or there is no more
ready-to-invoke callbacks, and when least one callback is pending,
__call_rcu_nocb_wake() will advance the callbacks, but refrain from
awakening the corresponding no-CBs grace-period kthread.  However,
because rcu_advance_cbs_nowake() is used, it is possible (if a bit
unlikely) that the needed advancement could not happen due to a grace
period not being in progress.  Plus there will always be at least one
pending callback due to one having just now been enqueued.

This commit therefore attempts to advance callbacks and awakens the
no-CBs grace-period kthread when there are excessive numbers of callbacks
posted and when the no-CBs callback kthread is not in a position to do
anything helpful.

Signed-off-by: Paul E. McKenney &lt;paulmck@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>rcu/nocb: Reduce -&gt;nocb_lock contention with separate -&gt;nocb_gp_lock</title>
<updated>2019-08-13T21:35:49Z</updated>
<author>
<name>Paul E. McKenney</name>
<email>paulmck@linux.ibm.com</email>
</author>
<published>2019-06-02T20:41:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4fd8c5f153bc41ae847b9ddb1539b34f70c18278'/>
<id>urn:sha1:4fd8c5f153bc41ae847b9ddb1539b34f70c18278</id>
<content type='text'>
The sleep/wakeup of the no-CBs grace-period kthreads is synchronized
using the -&gt;nocb_lock of the first CPU corresponding to that kthread.
This commit provides a separate -&gt;nocb_gp_lock for this purpose, thus
reducing contention on -&gt;nocb_lock.

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