<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/kernel/rcu/rcuscale.c, branch linux-6.15.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2024-11-15T21:24:41Z</updated>
<entry>
<title>rcuscale: Remove redundant WARN_ON_ONCE() splat</title>
<updated>2024-11-15T21:24:41Z</updated>
<author>
<name>Uladzislau Rezki (Sony)</name>
</author>
<published>2024-11-13T11:00:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c229d579d047f9c4fb4d6c37d9d04b88a398e461'/>
<id>urn:sha1:c229d579d047f9c4fb4d6c37d9d04b88a398e461</id>
<content type='text'>
There are two places where WARN_ON_ONCE() is called two times
in the error paths. One which is encapsulated into if() condition
and another one, which is unnecessary, is placed in the brackets.

Remove an extra WARN_ON_ONCE() splat which is in brackets.

Reviewed-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
Reviewed-by: Neeraj Upadhyay &lt;Neeraj.Upadhyay@amd.com&gt;
Signed-off-by: Uladzislau Rezki (Sony) &lt;urezki@gmail.com&gt;
Signed-off-by: Frederic Weisbecker &lt;frederic@kernel.org&gt;
</content>
</entry>
<entry>
<title>rcuscale: Do a proper cleanup if kfree_scale_init() fails</title>
<updated>2024-11-15T21:23:50Z</updated>
<author>
<name>Uladzislau Rezki (Sony)</name>
</author>
<published>2024-11-13T11:00:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=812a1c3b9f7c36d9255f0d29d0a3d324e2f52321'/>
<id>urn:sha1:812a1c3b9f7c36d9255f0d29d0a3d324e2f52321</id>
<content type='text'>
A static analyzer for C, Smatch, reports and triggers below
warnings:

   kernel/rcu/rcuscale.c:1215 rcu_scale_init()
   warn: inconsistent returns 'global &amp;fullstop_mutex'.

The checker complains about, we do not unlock the "fullstop_mutex"
mutex, in case of hitting below error path:

&lt;snip&gt;
...
    if (WARN_ON_ONCE(jiffies_at_lazy_cb - jif_start &lt; 2 * HZ)) {
        pr_alert("ERROR: call_rcu() CBs are not being lazy as expected!\n");
        WARN_ON_ONCE(1);
        return -1;
        ^^^^^^^^^^
...
&lt;snip&gt;

it happens because "-1" is returned right away instead of
doing a proper unwinding.

Fix it by jumping to "unwind" label instead of returning -1.

Reported-by: Dan Carpenter &lt;dan.carpenter@linaro.org&gt;
Reviewed-by: Paul E. McKenney &lt;paulmck@kernel.org&gt;
Reviewed-by: Neeraj Upadhyay &lt;Neeraj.Upadhyay@amd.com&gt;
Closes: https://lore.kernel.org/rcu/ZxfTrHuEGtgnOYWp@pc636/T/
Fixes: 084e04fff160 ("rcuscale: Add laziness and kfree tests")
Signed-off-by: Uladzislau Rezki (Sony) &lt;urezki@gmail.com&gt;
Signed-off-by: Frederic Weisbecker &lt;frederic@kernel.org&gt;
</content>
</entry>
<entry>
<title>rcuscale: Count outstanding callbacks per-task rather than per-CPU</title>
<updated>2024-08-14T18:44:48Z</updated>
<author>
<name>Paul E. McKenney</name>
</author>
<published>2024-08-02T00:43:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f1fd0e0bb12d09ca0564425b8af76fddf2e380fb'/>
<id>urn:sha1:f1fd0e0bb12d09ca0564425b8af76fddf2e380fb</id>
<content type='text'>
The current rcu_scale_writer() asynchronous grace-period testing uses a
per-CPU counter to track the number of outstanding callbacks.  This is
subject to CPU-imbalance errors when tasks migrate from one CPU to another
between the time that the counter is incremented and the callback is
queued, and additionally in kernels configured such that callbacks can
be invoked on some CPU other than the one that queued it.

This commit therefore arranges for per-task callback counts, thus avoiding
any issues with migration of either tasks or callbacks.

Reported-by: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Signed-off-by: "Paul E. McKenney" &lt;paulmck@kernel.org&gt;
Signed-off-by: Neeraj Upadhyay &lt;neeraj.upadhyay@kernel.org&gt;
</content>
</entry>
<entry>
<title>rcuscale: NULL out top-level pointers to heap memory</title>
<updated>2024-08-14T18:44:48Z</updated>
<author>
<name>Paul E. McKenney</name>
</author>
<published>2024-08-02T00:43:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=554f07a119866a78606b36123fb28e9451b1f994'/>
<id>urn:sha1:554f07a119866a78606b36123fb28e9451b1f994</id>
<content type='text'>
Currently, if someone modprobes and rmmods rcuscale successfully, but
the next run errors out during the modprobe, non-NULL pointers to freed
memory will remain.  If the run after that also errors out during the
modprobe, there will be double-free bugs.

This commit therefore NULLs out top-level pointers to memory that has
just been freed.

Signed-off-by: "Paul E. McKenney" &lt;paulmck@kernel.org&gt;
Signed-off-by: Neeraj Upadhyay &lt;neeraj.upadhyay@kernel.org&gt;
</content>
</entry>
<entry>
<title>rcuscale: Use special allocator for rcu_scale_writer()</title>
<updated>2024-08-14T18:44:48Z</updated>
<author>
<name>Paul E. McKenney</name>
</author>
<published>2024-08-02T00:43:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1c3e6e7903fa939601fdd326b04507304ba22337'/>
<id>urn:sha1:1c3e6e7903fa939601fdd326b04507304ba22337</id>
<content type='text'>
The rcu_scale_writer() function needs only a fixed number of rcu_head
structures per kthread, which means that a trivial allocator suffices.
This commit therefore uses an llist-based allocator using a fixed array of
structures per kthread.  This allows aggressive testing of RCU performance
without stressing the slab allocators.

Signed-off-by: "Paul E. McKenney" &lt;paulmck@kernel.org&gt;
Signed-off-by: Neeraj Upadhyay &lt;neeraj.upadhyay@kernel.org&gt;
</content>
</entry>
<entry>
<title>rcuscale: Make rcu_scale_writer() tolerate repeated GFP_KERNEL failure</title>
<updated>2024-08-14T18:44:48Z</updated>
<author>
<name>Paul E. McKenney</name>
</author>
<published>2024-08-02T00:43:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3e3c4f0e2753e92aa2a248d34c6866c0a264ac96'/>
<id>urn:sha1:3e3c4f0e2753e92aa2a248d34c6866c0a264ac96</id>
<content type='text'>
Under some conditions, kmalloc(GFP_KERNEL) allocations have been
observed to repeatedly fail.  This situation has been observed to
cause one of the rcu_scale_writer() instances to loop indefinitely
retrying memory allocation for an asynchronous grace-period primitive.
The problem is that if memory is short, all the other instances will
allocate all available memory before the looping task is awakened from
its rcu_barrier*() call.  This in turn results in hangs, so that rcuscale
fails to complete.

This commit therefore removes the tight retry loop, so that when this
condition occurs, the affected task is still passing through the full
loop with its full set of termination checks.  This spreads the risk
of indefinite memory-allocation retry failures across all instances of
rcu_scale_writer() tasks, which in turn prevents the hangs.

Signed-off-by: "Paul E. McKenney" &lt;paulmck@kernel.org&gt;
Signed-off-by: Neeraj Upadhyay &lt;neeraj.upadhyay@kernel.org&gt;
</content>
</entry>
<entry>
<title>rcuscale: Make all writer tasks report upon hang</title>
<updated>2024-08-14T18:44:48Z</updated>
<author>
<name>Paul E. McKenney</name>
</author>
<published>2024-08-02T00:43:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=abaf1322adbfd4faa28072fd5412e54b9722e477'/>
<id>urn:sha1:abaf1322adbfd4faa28072fd5412e54b9722e477</id>
<content type='text'>
This commit causes all writer tasks to provide a brief report after a
hang has been reported, spaced at one-second intervals.

Signed-off-by: "Paul E. McKenney" &lt;paulmck@kernel.org&gt;
Signed-off-by: Neeraj Upadhyay &lt;neeraj.upadhyay@kernel.org&gt;
</content>
</entry>
<entry>
<title>rcuscale: Provide clear error when async specified without primitives</title>
<updated>2024-08-14T18:42:24Z</updated>
<author>
<name>Paul E. McKenney</name>
</author>
<published>2024-08-02T00:43:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=11377947b5861fa59bf77c827e1dd7c081842cc9'/>
<id>urn:sha1:11377947b5861fa59bf77c827e1dd7c081842cc9</id>
<content type='text'>
Currently, if the rcuscale module's async module parameter is specified
for RCU implementations that do not have async primitives such as RCU
Tasks Rude (which now lacks a call_rcu_tasks_rude() function), there
will be a series of splats due to calls to a NULL pointer.  This commit
therefore warns of this situation, but switches to non-async testing.

Signed-off-by: "Paul E. McKenney" &lt;paulmck@kernel.org&gt;
Signed-off-by: Neeraj Upadhyay &lt;neeraj.upadhyay@kernel.org&gt;
</content>
</entry>
<entry>
<title>rcuscale: Print detailed grace-period and barrier diagnostics</title>
<updated>2024-08-14T11:36:01Z</updated>
<author>
<name>Paul E. McKenney</name>
</author>
<published>2024-08-02T00:43:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=674fc922f06f7632ac94536ca92dd8addb606f46'/>
<id>urn:sha1:674fc922f06f7632ac94536ca92dd8addb606f46</id>
<content type='text'>
This commit uses the new  rcu_tasks_torture_stats_print(),
rcu_tasks_trace_torture_stats_print(), and
rcu_tasks_rude_torture_stats_print() functions in order to provide
detailed diagnostics on grace-period, callback, and barrier state when
rcu_scale_writer() hangs.

[ paulmck: Apply kernel test robot feedback. ]

Signed-off-by: "Paul E. McKenney" &lt;paulmck@kernel.org&gt;
Signed-off-by: Neeraj Upadhyay &lt;neeraj.upadhyay@kernel.org&gt;
</content>
</entry>
<entry>
<title>rcuscale: Dump grace-period statistics when rcu_scale_writer() stalls</title>
<updated>2024-08-14T11:36:01Z</updated>
<author>
<name>Paul E. McKenney</name>
</author>
<published>2024-08-02T00:43:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=48c21c020fcacba6deb065c78ac1876418b5be11'/>
<id>urn:sha1:48c21c020fcacba6deb065c78ac1876418b5be11</id>
<content type='text'>
This commit adds a .stats function pointer to the rcu_scale_ops structure,
and if this is non-NULL, it is invoked after stack traces are dumped in
response to a rcu_scale_writer() stall.

Signed-off-by: "Paul E. McKenney" &lt;paulmck@kernel.org&gt;
Signed-off-by: Neeraj Upadhyay &lt;neeraj.upadhyay@kernel.org&gt;
</content>
</entry>
</feed>
