Messages in this thread Patch in this message | | | From | "Uladzislau Rezki (Sony)" <> | Subject | [PATCH 4/6] kvfree_rcu: add a bulk-list check when a scheduler is run | Date | Wed, 14 Apr 2021 14:12:24 +0200 |
| |
RCU_SCHEDULER_RUNNING is set when a scheduling is available. That signal is used in order to check and queue a "monitor work" to reclaim freed objects(if they are) during a boot-up phase.
We have it because, the main path of the kvfree_rcu() call can not queue the work untill the scheduler is up and running.
Currently in such helper only "krcp->head" is checked to figure out if there are outstanding objects to be released. And this is only one channel. After adding a bulk interface there are two extra which have to be checked also: "krcp->bkvhead[0]" as well as "krcp->bkvhead[1]". So, we have to queue the "monitor work" if _any_ corresponding channel is not empty.
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com> --- kernel/rcu/tree.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 31ee820c3d9e..da3605067cc1 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -3723,13 +3723,11 @@ 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 || test_and_set_bit(KRC_MONITOR_TODO, &krcp->flags)) { - raw_spin_unlock_irqrestore(&krcp->lock, flags); - continue; + if (krcp->bkvhead[0] || krcp->bkvhead[1] || krcp->head || + !test_and_set_bit(KRC_MONITOR_TODO, &krcp->flags)) { + schedule_delayed_work_on(cpu, &krcp->monitor_work, + KFREE_DRAIN_JIFFIES); } - - schedule_delayed_work_on(cpu, &krcp->monitor_work, - KFREE_DRAIN_JIFFIES); raw_spin_unlock_irqrestore(&krcp->lock, flags); } } -- 2.20.1
| |