[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200904170401.GB4295@mtj.thefacebook.com>
Date: Fri, 4 Sep 2020 13:04:01 -0400
From: Tejun Heo <tj@...nel.org>
To: Qianli Zhao <zhaoqianligood@...il.com>
Cc: jiangshanlai@...il.com, dan.carpenter@...cle.com,
Markus.Elfring@....de, linux-kernel@...r.kernel.org,
zhaoqianli@...omi.com
Subject: Re: [PATCH v4] workqueue: Warn when work flush own workqueue
On Thu, Aug 27, 2020 at 02:09:11PM +0800, Qianli Zhao wrote:
> @@ -2594,13 +2595,17 @@ static void check_flush_dependency(struct workqueue_struct *target_wq,
> struct work_struct *target_work)
> {
> work_func_t target_func = target_work ? target_work->func : NULL;
> - struct worker *worker;
> + struct worker *worker = current_wq_worker();
> +
> + WARN_ONCE(worker && worker->current_pwq->wq == target_wq &&
> + worker->task == current &&
> + (target_work ? worker->current_work == target_work : true),
> + "workqueue: current work function:%ps is flushing own workqueue:%s",
> + worker->current_func, target_wq->name);
So, the idea is that we catch these with lockdeps. Doesn't lockdep trigger
for the same condition?
Thanks.
--
tejun
Powered by blists - more mailing lists