Skip to contentSkip to conversation

kthread: work could not be queued when worker being destroyed

PATCH Superseded [email protected] 3 participants 3 messages Jul 3, 2020

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 kthread: work could not be queued when worker being destroyed

From: Zhang Qiang <[email protected]>

The "queuing_blocked" func should print warning message and returns true when the worker being destroyed.

---
v1->v2:
Add warning information for condition "!worker->task"

 kernel/kthread.c | 3 +++
 1 file changed, 3 insertions(+)
kernel/kthread.c +3 -0
index bfbfa481be3a..cac5184ffd86 100644
@@ -791,6 +791,9 @@ static inline bool queuing_blocked(struct kthread_worker *worker,
 {
 	lockdep_assert_held(&worker->lock);
 
+	if (WARN_ON(!worker->task))
+		return true;
+
 	return !list_empty(&work->node) || work->canceling;
 }
 
Signature · 1 line
2.24.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 7 lines · On Thu 2020-07-02 15:01:56, [email protected] wrote:

From: Zhang Qiang <[email protected]>

The "queuing_blocked" func should print warning message and returns true when the worker being destroyed.

Looks good to me.

Adding Andrew into CC. Changes in kernel/kthread.c usually goes through him. You might need to resend the patch once again with Andrew in CC.

Best Regards,
Petr Mladek