diff options
author | Uladzislau Rezki (Sony) <urezki@gmail.com> | 2021-04-15 19:19:58 +0200 |
---|---|---|
committer | Paul E. McKenney <paulmck@kernel.org> | 2021-05-10 16:00:48 -0700 |
commit | d434c00fa3ac476ca6295b8310d097dd71984624 (patch) | |
tree | 0d341051c871285303b009cc26d747c7550cf99e /kernel/rcu | |
parent | ac7625ebd5f7bad93f821b7397fe50635f58aa4b (diff) | |
download | linux-d434c00fa3ac476ca6295b8310d097dd71984624.tar.gz linux-d434c00fa3ac476ca6295b8310d097dd71984624.tar.bz2 linux-d434c00fa3ac476ca6295b8310d097dd71984624.zip |
kvfree_rcu: Add a bulk-list check when a scheduler is run
The rcu_scheduler_active flag is set to RCU_SCHEDULER_RUNNING once the
scheduler is up and running. That signal is used in order to check
and queue a "monitor work" to reclaim freed objects (if there are any)
during early boot. This flag is used by kvfree_rcu() to determine when
work can safely be queued, at which point memory passed to earlier
invocations of kvfree_rcu() can be processed.
However, only "krcp->head" is checked for objects that need to be
released, and there are now two more, namely, "krcp->bkvhead[0]" and
"krcp->bkvhead[1]". Therefore, check these two additional channels.
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'kernel/rcu')
-rw-r--r-- | kernel/rcu/tree.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 676a49ab5b2b..e86f32d6b8f9 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -3739,7 +3739,8 @@ void __init kfree_rcu_scheduler_running(void) struct kfree_rcu_cpu *krcp = per_cpu_ptr(&krc, cpu); raw_spin_lock_irqsave(&krcp->lock, flags); - if (!krcp->head || krcp->monitor_todo) { + if ((!krcp->bkvhead[0] && !krcp->bkvhead[1] && !krcp->head) || + krcp->monitor_todo) { raw_spin_unlock_irqrestore(&krcp->lock, flags); continue; } |