[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <498FD94B.7010205@cn.fujitsu.com>
Date: Mon, 09 Feb 2009 15:20:43 +0800
From: Lai Jiangshan <laijs@...fujitsu.com>
To: Oleg Nesterov <oleg@...hat.com>
CC: Peter Zijlstra <peterz@...radead.org>,
Frédéric Weisbecker
<fweisbec@...il.com>, Ingo Molnar <mingo@...e.hu>,
Andrew Morton <akpm@...ux-foundation.org>,
Eric Dumazet <dada1@...mosbay.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/3] workqueue: not allow recursion run_workqueue
Oleg Nesterov wrote:
> On 02/06, Lai Jiangshan wrote:
>> Oleg Nesterov wrote:
>>> On 02/05, Lai Jiangshan wrote:
>>>> DEADLOCK EXAMPLE for explain my above option:
>>>>
>>>> (work_func0() and work_func1() are work callback, and they
>>>> calls flush_workqueue())
>>>>
>>>> CPU#0 CPU#1
>>>> run_workqueue() run_workqueue()
>>>> work_func0() work_func1()
>>>> flush_workqueue() flush_workqueue()
>>>> flush_cpu_workqueue(0) .
>>>> flush_cpu_workqueue(cpu#1) flush_cpu_workqueue(cpu#0)
>>>> waiting work_func1() in cpu#1 waiting work_func0 in cpu#0
>>>>
>>>> DEADLOCK!
>>> I am not sure. Note that when work_func0() calls run_workqueue(),
>>> it will clear cwq->current_work, so another flush_ on CPU#1 will
>>> not wait for work_func0, no?
>> cwq->current_work is changed only when
>> !list_empty(&cwq->worklist)
>> in run_workqueue().
>>
>> so cwq->current_work may not be changed.
>
> Ah, indeed.
>
> Thanks for correcting me!
>
> Oleg.
>
>
>
>
Thanks,
Could you Ack these patches?
Lai.
--
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