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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EE8CDC83030 for ; Thu, 3 Jul 2025 12:55:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=m9LVBAxy0jsSIhgOs8WB62wgXE4hTLBcwM36iAsZa10=; b=gURLpkXgGeavEMCDCTgep8kw56 gcTmm67cKQ3oTx8/g3IaWjYN1C0wsy8FI2NHdJJlHlrAU/oVclfVe7qQqq+dJ3bz2rLWFa1OPlw4J wlwVFzMqsUXV3BgE6X3xSUB9dAfY9kmZKG/lHzRzFCHoOt8672TkommDuV7MExcBj69FuEV3iUAXV M932eNFWxeX5Erg/Bw1AtIY9uNPK8xAINhJA+HhO2BGJP1t8LZ45MHjpPAKx3me1ZA2vwwmX/VvEO H3oRwKPlyrp0w2mCKQlbY7Xs0x8fl8bXJC7hSU72zCEwthuSsTZ42CemWKg+IlEU7gXHONEnAyXce 2SUf6jWw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uXJTg-0000000BPAe-2MqH; Thu, 03 Jul 2025 12:55:48 +0000 Received: from verein.lst.de ([213.95.11.211]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uXIP6-0000000BCth-3QEW for linux-nvme@lists.infradead.org; Thu, 03 Jul 2025 11:47:01 +0000 Received: by verein.lst.de (Postfix, from userid 2407) id E6C9F67373; Thu, 3 Jul 2025 13:46:56 +0200 (CEST) Date: Thu, 3 Jul 2025 13:46:56 +0200 From: Christoph Hellwig To: Stuart Hayes Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , "Rafael J . Wysocki" , Martin Belanger , Oliver O'Halloran , Daniel Wagner , Keith Busch , Lukas Wunner , David Jeffery , Jeremy Allison , Jens Axboe , Christoph Hellwig , Sagi Grimberg , linux-nvme@lists.infradead.org, Nathan Chancellor , Jan Kiszka , Bert Karwatzki Subject: Re: [PATCH v10 0/5] shut down devices asynchronously Message-ID: <20250703114656.GE17686@lst.de> References: <20250625201853.84062-1-stuart.w.hayes@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250625201853.84062-1-stuart.w.hayes@gmail.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250703_044700_991017_F53E3098 X-CRM114-Status: GOOD ( 13.56 ) X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org On Wed, Jun 25, 2025 at 03:18:48PM -0500, Stuart Hayes wrote: > Address resource and timing issues when spawning a unique async thread > for every device during shutdown: > * Make the asynchronous threads able to shut down multiple devices, > instead of spawning a unique thread for every device. > * Modify core kernel async code with a custom wake function so it > doesn't wake up threads waiting to synchronize every time the cookie > changes Given all these thread spawning issues, why can't we just go back to the approach that kicks off shutdown asynchronously and then waits for it without spawning all these threads?