From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1D45C433EF for ; Sat, 12 Feb 2022 17:14:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235954AbiBLROc (ORCPT ); Sat, 12 Feb 2022 12:14:32 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:40472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229947AbiBLRO3 (ORCPT ); Sat, 12 Feb 2022 12:14:29 -0500 Received: from www262.sakura.ne.jp (www262.sakura.ne.jp [202.181.97.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AD7B240A4; Sat, 12 Feb 2022 09:14:25 -0800 (PST) Received: from fsav119.sakura.ne.jp (fsav119.sakura.ne.jp [27.133.134.246]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 21CHEDgr055636; Sun, 13 Feb 2022 02:14:13 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav119.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav119.sakura.ne.jp); Sun, 13 Feb 2022 02:14:13 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav119.sakura.ne.jp) Received: from [192.168.1.9] (M106072142033.v4.enabler.ne.jp [106.72.142.33]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 21CHEDvD055633 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Sun, 13 Feb 2022 02:14:13 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Message-ID: <309c86b7-2a4c-1332-585f-7bcd59cfd762@I-love.SAKURA.ne.jp> Date: Sun, 13 Feb 2022 02:14:09 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: [syzbot] possible deadlock in worker_thread Content-Language: en-US To: Bart Van Assche , syzbot , jgg@ziepe.ca, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, syzkaller-bugs@googlegroups.com, Tejun Heo , Lai Jiangshan References: <0000000000005975a605d7aef05e@google.com> <8ea57ddf-a09c-43f2-4285-4dfb908ad967@acm.org> <71d6f14e-46af-cc5a-bc70-af1cdc6de8d5@acm.org> From: Tetsuo Handa In-Reply-To: <71d6f14e-46af-cc5a-bc70-af1cdc6de8d5@acm.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/02/13 1:37, Bart Van Assche wrote: > On 2/11/22 21:31, Tetsuo Handa wrote: >> But this report might be suggesting us that we should consider >> deprecating (and eventually getting rid of) system-wide workqueues >> (declared in include/linux/workqueue.h), for since flush_workqueue() >> synchronously waits for completion, sharing system-wide workqueues >> among multiple modules can generate unexpected locking dependency >> chain (like this report). > > I do not agree with deprecating system-wide workqueues. I think that > all flush_workqueue(system_long_wq) calls should be reviewed since > these are deadlock-prone. > > Thanks, > > Bart. The loop module is not using flush_workqueue(system_long_wq) call; it only scheduled a work via system_long_wq which will call flush_workqueue() (of a local workqueue) from drain_workqueue() from destroy_workqueue() from work function. How can reviewing all flush_workqueue(system_long_wq) calls help?