All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] kthread: work could not be queued when worker being destroyed
@ 2020-07-02  7:01 qiang.zhang
  2020-07-03 11:11 ` Petr Mladek
  2020-07-03 19:13 ` Andrew Morton
  0 siblings, 2 replies; 3+ messages in thread
From: qiang.zhang @ 2020-07-02  7:01 UTC (permalink / raw)
  To: ben.dooks, bfields, cl, peterz, pmladek, tj; +Cc: linux-kernel

From: Zhang Qiang <qiang.zhang@windriver.com>

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

Suggested-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Zhang Qiang <qiang.zhang@windriver.com>
---
 v1->v2:
 Add warning information for condition "!worker->task"	

 kernel/kthread.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/kthread.c b/kernel/kthread.c
index bfbfa481be3a..cac5184ffd86 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -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;
 }
 
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] kthread: work could not be queued when worker being destroyed
  2020-07-02  7:01 [PATCH v2] kthread: work could not be queued when worker being destroyed qiang.zhang
@ 2020-07-03 11:11 ` Petr Mladek
  2020-07-03 19:13 ` Andrew Morton
  1 sibling, 0 replies; 3+ messages in thread
From: Petr Mladek @ 2020-07-03 11:11 UTC (permalink / raw)
  To: qiang.zhang
  Cc: ben.dooks, bfields, cl, peterz, tj, linux-kernel, Andrew Morton

On Thu 2020-07-02 15:01:56, qiang.zhang@windriver.com wrote:
> From: Zhang Qiang <qiang.zhang@windriver.com>
> 
> The "queuing_blocked" func should print warning message and
> returns true when the worker being destroyed.
>
> Suggested-by: Petr Mladek <pmladek@suse.com>
> Signed-off-by: Zhang Qiang <qiang.zhang@windriver.com>

Looks good to me.

Reviewed-by: Petr Mladek <pmladek@suse.com>

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] kthread: work could not be queued when worker being destroyed
  2020-07-02  7:01 [PATCH v2] kthread: work could not be queued when worker being destroyed qiang.zhang
  2020-07-03 11:11 ` Petr Mladek
@ 2020-07-03 19:13 ` Andrew Morton
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2020-07-03 19:13 UTC (permalink / raw)
  To: qiang.zhang; +Cc: ben.dooks, bfields, cl, peterz, pmladek, tj, linux-kernel

On Thu, 2 Jul 2020 15:01:56 +0800 <qiang.zhang@windriver.com> wrote:

> From: Zhang Qiang <qiang.zhang@windriver.com>
> 
> The "queuing_blocked" func should print warning message and
> returns true when the worker being destroyed.

Why should it do this?

Please prepare a changelog which contains much more information.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-03 19:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-02  7:01 [PATCH v2] kthread: work could not be queued when worker being destroyed qiang.zhang
2020-07-03 11:11 ` Petr Mladek
2020-07-03 19:13 ` Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.