[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100204105213.GB21188@redhat.com>
Date: Thu, 4 Feb 2010 11:52:13 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Simon Kagstrom <simon.kagstrom@...insight.net>
Cc: Tejun Heo <tj@...nel.org>, linux-kernel@...r.kernel.org,
laijs@...fujitsu.com, rusty@...tcorp.com.au,
akpm@...ux-foundation.org, mingo@...e.hu
Subject: Re: [PATCH v2] core: workqueue: return on workqueue recursion
On 02/04, Simon Kagstrom wrote:
>
> When the workqueue is flushed from workqueue context (recursively), the
> system enters a strange state where things at random (dependent on the
> global workqueue) start misbehaving. For example, for us the console and
> logins locks up while the web server continues running.
>
> The system becomes unstable since the workqueue barrier locks the
> workqueue. This patch instead returns if the workqueue is flushed
> recursively, which keeps the workqueue alive but warns.
>
> Signed-off-by: Simon Kagstrom <simon.kagstrom@...insight.net>
Acked-by: Oleg Nesterov <oleg@...hat.com>
> ---
> ChangeLog:
> * Instead of BUG_ON, warn and return on recursive calls as suggested
> by Oleg Nesterov and Tejun Hao
>
> kernel/workqueue.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/kernel/workqueue.c b/kernel/workqueue.c
> index dee4865..49f8fa7 100644
> --- a/kernel/workqueue.c
> +++ b/kernel/workqueue.c
> @@ -482,7 +482,8 @@ static int flush_cpu_workqueue(struct cpu_workqueue_struct *cwq)
> int active = 0;
> struct wq_barrier barr;
>
> - WARN_ON(cwq->thread == current);
> + if (WARN_ON(cwq->thread == current))
> + return 1;
>
> spin_lock_irq(&cwq->lock);
> if (!list_empty(&cwq->worklist) || cwq->current_work != NULL) {
> --
> 1.6.0.4
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists