[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <afa1ac2c-a023-a91e-e596-60931b38247e@I-love.SAKURA.ne.jp>
Date: Fri, 29 Jul 2022 11:28:40 +0900
From: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
To: Johannes Berg <johannes.berg@...el.com>
Cc: Lai Jiangshan <jiangshanlai@...il.com>,
Hillf Danton <hdanton@...a.com>,
LKML <linux-kernel@...r.kernel.org>, Tejun Heo <tj@...nel.org>
Subject: Re: [PATCH] workqueue: don't skip lockdep wq dependency in
cancel_work_sync()
Thinking more, I might be confused by difference between
the lockdep "struct work_struct" dependency handling
and
the lockdep "struct work" dependency handling
. In an example that
work3_function() { /* nothing */ }
work4_function() { mutex_lock(&mutex); ... }
other_function() {
queue_work(ordered_wq, &work3);
queue_work(ordered_wq, &work4);
mutex_lock(&mutex);
cancel_work_sync(&work4);
}
, possibility of deadlock must be reported by lockdep via
the lockdep "struct work" dependency handling.
Then, prior to commit d6e89786bed977f3, lockdep flagging
the lockdep "struct work_struct" dependency handling
as if cancel_work_sync() was flush_work() is a problem, and
lockdep not flagging
the lockdep "struct work" dependency handling
from cancel_work_sync() as if flush_work() is also a problem.
Then, commit d6e89786bed977f3 might be OK, but commit 87915adc3f0acdf0
was wrong in that it preserved lockdep not flagging
the lockdep "struct work" dependency handling
from cancel_work_sync() as if flush_work().
Powered by blists - more mailing lists