Skip to content

Commit 594aa59

Browse files
urezkipaulmckrcu
authored andcommitted
rcu/tree: Repeat the monitor if any free channel is busy
It is possible that one of the channels cannot be detached because its free channel is busy and previously queued data has not been processed yet. On the other hand, another channel can be successfully detached causing the monitor work to stop. Prevent that by rescheduling the monitor work if there are any channels in the pending state after a detach attempt. Fixes: 34c8817 ("rcu: Support kfree_bulk() interface in kfree_rcu()") Acked-by: Joel Fernandes (Google) <[email protected]> Signed-off-by: Uladzislau Rezki (Sony) <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 4d29194 commit 594aa59

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

kernel/rcu/tree.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3105,7 +3105,7 @@ static void kfree_rcu_work(struct work_struct *work)
31053105
static inline bool queue_kfree_rcu_work(struct kfree_rcu_cpu *krcp)
31063106
{
31073107
struct kfree_rcu_cpu_work *krwp;
3108-
bool queued = false;
3108+
bool repeat = false;
31093109
int i;
31103110

31113111
lockdep_assert_held(&krcp->lock);
@@ -3143,11 +3143,14 @@ static inline bool queue_kfree_rcu_work(struct kfree_rcu_cpu *krcp)
31433143
* been detached following each other, one by one.
31443144
*/
31453145
queue_rcu_work(system_wq, &krwp->rcu_work);
3146-
queued = true;
31473146
}
3147+
3148+
/* Repeat if any "free" corresponding channel is still busy. */
3149+
if (krcp->bhead || krcp->head)
3150+
repeat = true;
31483151
}
31493152

3150-
return queued;
3153+
return !repeat;
31513154
}
31523155

31533156
static inline void kfree_rcu_drain_unlock(struct kfree_rcu_cpu *krcp,

0 commit comments

Comments
 (0)