[PATCH] PM / suspend: show workqueues busy name in suspend flow

Tejun Heo tj at kernel.org
Wed Jun 22 08:21:26 PDT 2016


Hello,

On Wed, Jun 22, 2016 at 05:08:29PM +0800, Roger Lu wrote:
> When suspend flow is aborted because of workqueues busy,
> show workqueues busy name for debug purpose.
> 
> Signed-off-by: Roger Lu <roger.lu at mediatek.com>
> ---
>  include/linux/workqueue.h |  1 +
>  kernel/power/process.c    |  3 +++
>  kernel/workqueue.c        | 35 +++++++++++++++++++++++++++++++++++
>  3 files changed, 39 insertions(+)
> 
> diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
> index ca73c50..c9f9b24 100644
> --- a/include/linux/workqueue.h
> +++ b/include/linux/workqueue.h
> @@ -609,6 +609,7 @@ long work_on_cpu(int cpu, long (*fn)(void *), void
>  *arg);
>  #ifdef CONFIG_FREEZER
>  extern void freeze_workqueues_begin(void);
>  extern bool freeze_workqueues_busy(void);
> +extern void show_workqueues_busy(void);
>  extern void thaw_workqueues(void);
>  #endif /* CONFIG_FREEZER */
>  
> diff --git a/kernel/power/process.c b/kernel/power/process.c
> index df058be..b538881 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_workqueues_busy();

I think it'd probably be better to call show_workqueue_state() instead
so that we can get a full picture of what's going on.

Thanks.

-- 
tejun



More information about the linux-arm-kernel mailing list