All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PM / suspend: show workqueue state in suspend flow
@ 2016-06-30  3:17 ` Roger Lu
  0 siblings, 0 replies; 5+ messages in thread
From: Roger Lu @ 2016-06-30  3:17 UTC (permalink / raw)
  To: Rafael J . Wysocki, Len Brown, Pavel Machek, Tejun Heo
  Cc: srv_heupstream, linux-mediatek, Sascha Hauer, Lai Jiangshan,
	Matthias Brugger, linux-pm, linux-kernel, linux-arm-kernel,
	Roger Lu

If freezable workqueue aborts suspend flow, show
workqueue state for debug purpose.

Signed-off-by: Roger Lu <roger.lu@mediatek.com>
---
 kernel/power/process.c | 3 +++
 kernel/workqueue.c     | 7 +++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/kernel/power/process.c b/kernel/power/process.c
index df058be..6eef250 100644
--- a/kernel/power/process.c
+++ b/kernel/power/process.c
@@ -89,6 +89,9 @@ static int try_to_freeze_tasks(bool user_only)
 		       elapsed_msecs / 1000, elapsed_msecs % 1000,
 		       todo - wq_busy, wq_busy);
 
+		if (wq_busy)
+			show_workqueue_state();
+
 		if (!wakeup) {
 			read_lock(&tasklist_lock);
 			for_each_process_thread(g, p) {
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index e1c0e99..c945617 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -4369,8 +4369,8 @@ static void show_pwq(struct pool_workqueue *pwq)
 /**
  * show_workqueue_state - dump workqueue state
  *
- * Called from a sysrq handler and prints out all busy workqueues and
- * pools.
+ * Called from a sysrq handler or try_to_freeze_tasks() and prints out
+ * all busy workqueues and pools.
  */
 void show_workqueue_state(void)
 {
@@ -4396,6 +4396,9 @@ void show_workqueue_state(void)
 		if (idle)
 			continue;
 
+		if (wq->flags & WQ_FREEZABLE)
+			pr_info("freezable ");
+
 		pr_info("workqueue %s: flags=0x%x\n", wq->name, wq->flags);
 
 		for_each_pwq(pwq, wq) {
-- 
2.6.4

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

* [PATCH] PM / suspend: show workqueue state in suspend flow
@ 2016-06-30  3:17 ` Roger Lu
  0 siblings, 0 replies; 5+ messages in thread
From: Roger Lu @ 2016-06-30  3:17 UTC (permalink / raw)
  To: Rafael J . Wysocki, Len Brown, Pavel Machek, Tejun Heo
  Cc: srv_heupstream, linux-mediatek, Sascha Hauer, Lai Jiangshan,
	Matthias Brugger, linux-pm, linux-kernel, linux-arm-kernel,
	Roger Lu

If freezable workqueue aborts suspend flow, show
workqueue state for debug purpose.

Signed-off-by: Roger Lu <roger.lu@mediatek.com>
---
 kernel/power/process.c | 3 +++
 kernel/workqueue.c     | 7 +++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/kernel/power/process.c b/kernel/power/process.c
index df058be..6eef250 100644
--- a/kernel/power/process.c
+++ b/kernel/power/process.c
@@ -89,6 +89,9 @@ static int try_to_freeze_tasks(bool user_only)
 		       elapsed_msecs / 1000, elapsed_msecs % 1000,
 		       todo - wq_busy, wq_busy);
 
+		if (wq_busy)
+			show_workqueue_state();
+
 		if (!wakeup) {
 			read_lock(&tasklist_lock);
 			for_each_process_thread(g, p) {
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index e1c0e99..c945617 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -4369,8 +4369,8 @@ static void show_pwq(struct pool_workqueue *pwq)
 /**
  * show_workqueue_state - dump workqueue state
  *
- * Called from a sysrq handler and prints out all busy workqueues and
- * pools.
+ * Called from a sysrq handler or try_to_freeze_tasks() and prints out
+ * all busy workqueues and pools.
  */
 void show_workqueue_state(void)
 {
@@ -4396,6 +4396,9 @@ void show_workqueue_state(void)
 		if (idle)
 			continue;
 
+		if (wq->flags & WQ_FREEZABLE)
+			pr_info("freezable ");
+
 		pr_info("workqueue %s: flags=0x%x\n", wq->name, wq->flags);
 
 		for_each_pwq(pwq, wq) {
-- 
2.6.4


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

* [PATCH] PM / suspend: show workqueue state in suspend flow
@ 2016-06-30  3:17 ` Roger Lu
  0 siblings, 0 replies; 5+ messages in thread
From: Roger Lu @ 2016-06-30  3:17 UTC (permalink / raw)
  To: linux-arm-kernel

If freezable workqueue aborts suspend flow, show
workqueue state for debug purpose.

Signed-off-by: Roger Lu <roger.lu@mediatek.com>
---
 kernel/power/process.c | 3 +++
 kernel/workqueue.c     | 7 +++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/kernel/power/process.c b/kernel/power/process.c
index df058be..6eef250 100644
--- a/kernel/power/process.c
+++ b/kernel/power/process.c
@@ -89,6 +89,9 @@ static int try_to_freeze_tasks(bool user_only)
 		       elapsed_msecs / 1000, elapsed_msecs % 1000,
 		       todo - wq_busy, wq_busy);
 
+		if (wq_busy)
+			show_workqueue_state();
+
 		if (!wakeup) {
 			read_lock(&tasklist_lock);
 			for_each_process_thread(g, p) {
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index e1c0e99..c945617 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -4369,8 +4369,8 @@ static void show_pwq(struct pool_workqueue *pwq)
 /**
  * show_workqueue_state - dump workqueue state
  *
- * Called from a sysrq handler and prints out all busy workqueues and
- * pools.
+ * Called from a sysrq handler or try_to_freeze_tasks() and prints out
+ * all busy workqueues and pools.
  */
 void show_workqueue_state(void)
 {
@@ -4396,6 +4396,9 @@ void show_workqueue_state(void)
 		if (idle)
 			continue;
 
+		if (wq->flags & WQ_FREEZABLE)
+			pr_info("freezable ");
+
 		pr_info("workqueue %s: flags=0x%x\n", wq->name, wq->flags);
 
 		for_each_pwq(pwq, wq) {
-- 
2.6.4

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

* Re: [PATCH] PM / suspend: show workqueue state in suspend flow
  2016-06-30  3:17 ` Roger Lu
@ 2016-06-30  9:51   ` Tejun Heo
  -1 siblings, 0 replies; 5+ messages in thread
From: Tejun Heo @ 2016-06-30  9:51 UTC (permalink / raw)
  To: Roger Lu
  Cc: Rafael J . Wysocki, Len Brown, Pavel Machek, srv_heupstream,
	linux-mediatek, Sascha Hauer, Lai Jiangshan, Matthias Brugger,
	linux-pm, linux-kernel, linux-arm-kernel

Hello,

On Thu, Jun 30, 2016 at 11:17:46AM +0800, Roger Lu wrote:
> +		if (wq->flags & WQ_FREEZABLE)
> +			pr_info("freezable ");

The flag is already printed below and doing this will make the output
more difficult to read.

>  		pr_info("workqueue %s: flags=0x%x\n", wq->name, wq->flags);

Thanks.

-- 
tejun

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

* [PATCH] PM / suspend: show workqueue state in suspend flow
@ 2016-06-30  9:51   ` Tejun Heo
  0 siblings, 0 replies; 5+ messages in thread
From: Tejun Heo @ 2016-06-30  9:51 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

On Thu, Jun 30, 2016 at 11:17:46AM +0800, Roger Lu wrote:
> +		if (wq->flags & WQ_FREEZABLE)
> +			pr_info("freezable ");

The flag is already printed below and doing this will make the output
more difficult to read.

>  		pr_info("workqueue %s: flags=0x%x\n", wq->name, wq->flags);

Thanks.

-- 
tejun

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

end of thread, other threads:[~2016-06-30  9:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-30  3:17 [PATCH] PM / suspend: show workqueue state in suspend flow Roger Lu
2016-06-30  3:17 ` Roger Lu
2016-06-30  3:17 ` Roger Lu
2016-06-30  9:51 ` Tejun Heo
2016-06-30  9:51   ` Tejun Heo

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.