]> www.infradead.org Git - users/jedix/linux-maple.git/commit
rcuscale: Make rcu_scale_writer() tolerate repeated GFP_KERNEL failure
authorPaul E. McKenney <paulmck@kernel.org>
Fri, 2 Aug 2024 00:43:05 +0000 (17:43 -0700)
committerNeeraj Upadhyay <neeraj.upadhyay@kernel.org>
Wed, 14 Aug 2024 18:44:48 +0000 (00:14 +0530)
commit3e3c4f0e2753e92aa2a248d34c6866c0a264ac96
tree2a68876c95887d8db67712631a35f2ea3af31c72
parentabaf1322adbfd4faa28072fd5412e54b9722e477
rcuscale: Make rcu_scale_writer() tolerate repeated GFP_KERNEL failure

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" <paulmck@kernel.org>
Signed-off-by: Neeraj Upadhyay <neeraj.upadhyay@kernel.org>
kernel/rcu/rcuscale.c