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 4E21AC6FD1C for ; Fri, 24 Mar 2023 01:11:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230426AbjCXBLu (ORCPT ); Thu, 23 Mar 2023 21:11:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230267AbjCXBLt (ORCPT ); Thu, 23 Mar 2023 21:11:49 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31AC62B609 for ; Thu, 23 Mar 2023 18:11:41 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 8D41E68B05; Fri, 24 Mar 2023 02:11:38 +0100 (CET) Date: Fri, 24 Mar 2023 02:11:38 +0100 From: Christoph Hellwig To: Qu Wenruo Cc: Christoph Hellwig , Chris Mason , Josef Bacik , David Sterba , Johannes Thumshirn , linux-btrfs@vger.kernel.org Subject: Re: [PATCH 03/10] btrfs: offload all write I/O completions to a workqueue Message-ID: <20230324011138.GC12152@lst.de> References: <20230314165910.373347-4-hch@lst.de> <2aa047a7-984e-8f6f-163e-8fe6d12a41d8@gmx.com> <20230320123059.GB9008@lst.de> <20230321125550.GB10470@lst.de> <5eebb0fc-0be3-c313-27cd-4e11a7b04405@gmx.com> <20230322083258.GA23315@lst.de> <20230323081237.GA21669@lst.de> <6b1d2d63-ef00-3c6c-8bea-481e46b6fcef@gmx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6b1d2d63-ef00-3c6c-8bea-481e46b6fcef@gmx.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Thu, Mar 23, 2023 at 04:20:45PM +0800, Qu Wenruo wrote: > I'm just wondering if we all know that we should avoid cross-workqueue > dependency to avoid deadlock, then why no one is trying to expose any such > deadlocks by simply limiting max_active to 1 for all workqueues? Cross workqueue dependencies are not a problem per se, and a lot of places in the kernel rely on them. Dependencies on another work_struct on the same workqueue on the other hand are a problem. > Especially with lockdep, once we got a reproduce, it should not be that > hard to fix. lockdep helps you to find them without requiring to limit the max_active.