kvfree_rcu: Update "monitor_todo" once a batch is started

Before attempting to start a new batch the "monitor_todo" variable is
set to "false" and set back to "true" when a previous RCU batch is still
in progress.  This is at best confusing.

Thus change this variable to "false" only when a new batch has been
successfully queued, otherwise, just leave it be.

Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
This commit is contained in:
Uladzislau Rezki (Sony) 2021-04-15 19:19:59 +02:00 коммит произвёл Paul E. McKenney
Родитель d434c00fa3
Коммит dd28c9f057
1 изменённых файлов: 1 добавлений и 2 удалений

Просмотреть файл

@ -3442,15 +3442,14 @@ static inline void kfree_rcu_drain_unlock(struct kfree_rcu_cpu *krcp,
unsigned long flags) unsigned long flags)
{ {
// Attempt to start a new batch. // Attempt to start a new batch.
krcp->monitor_todo = false;
if (queue_kfree_rcu_work(krcp)) { if (queue_kfree_rcu_work(krcp)) {
// Success! Our job is done here. // Success! Our job is done here.
krcp->monitor_todo = false;
raw_spin_unlock_irqrestore(&krcp->lock, flags); raw_spin_unlock_irqrestore(&krcp->lock, flags);
return; return;
} }
// Previous RCU batch still in progress, try again later. // Previous RCU batch still in progress, try again later.
krcp->monitor_todo = true;
schedule_delayed_work(&krcp->monitor_work, KFREE_DRAIN_JIFFIES); schedule_delayed_work(&krcp->monitor_work, KFREE_DRAIN_JIFFIES);
raw_spin_unlock_irqrestore(&krcp->lock, flags); raw_spin_unlock_irqrestore(&krcp->lock, flags);
} }