Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp8111159rdb; Thu, 4 Jan 2024 21:05:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IGlYaSo93BzcP0ypZMVINYwCj6QaumcHl7PwLMg4Y0mJRe+JiP89GaxlMU5B+uZJ/x8LYns X-Received: by 2002:a05:6870:9c8a:b0:204:1ae1:e538 with SMTP id pq10-20020a0568709c8a00b002041ae1e538mr1621881oab.6.1704431138704; Thu, 04 Jan 2024 21:05:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704431138; cv=none; d=google.com; s=arc-20160816; b=rvM+Ion5/GAazEHh9kmB4GZSi9bzllNgzyYRigEzwuupXICu70w3YxEsmDeH9vpM/S c4UU0UGSVbKjAwmpbsYndxbhPbzRETyY4U8bkIRjHRersxHM8mWX5IqhxCkPriPhJeoh p/FWgAR1y1YR6B+oOj+vpfizdqwT/kiwu8MViQjVyx3mm42IZ5BHJlnRvBNLnmcZhtV1 SaNA6clXrKEuEfmQvJYAGbyvbaVq6HcB7MeHRVCogBphvpGTLAzcQoORUfhzrW7+8qj2 xPqPt52K/HadxOJI8ILHhXgjhek1crH1EgfO3Vb9VeV9tDfwu4hZL51aZ86MIvgeveJb e4FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=hE0MXGZMpk2MjjB9KslygeILx33BVOj3O1wz/Y/lL+k=; fh=YqGcVtRsuIYCD9t31yuifSbWDVeN4Yn5FuictIy47kA=; b=yM1pBgmJAtRwFrFbH3YCb/fnJs0o5Q2hJ7M8JTIfvXDSeRGLBFyoXImBEt4loHBgA1 tduaphQDonRcQh71ILZpIGr3hahHOFhTuJT3p5k8xg4djXNcg8qUPllCKkRjLXzCpp4I YPjwu7Zn61iKEyxJNxNQ+w+ZG1o0Mkk1zcG5Y62t49O4plXOsFcmtITX9vEpy9wut8Uq TIxOk+aASLMnegXBLG09T7JqbJeQEhvAhMubSRgTkMllRJwzjP6jWTDADpteTrQI10Lp 7jK+qPtwPyiBHa4o4SzSm2sLXeMCXaDhg2uCjezH9tyMmMFTw5iFOtWmhPW4K8bV4rfv v4NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rUdMMVXM; spf=pass (google.com: domain of linux-kernel+bounces-17477-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17477-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id l14-20020a63f30e000000b005c67029a131si743646pgh.220.2024.01.04.21.05.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 21:05:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17477-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rUdMMVXM; spf=pass (google.com: domain of linux-kernel+bounces-17477-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17477-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 49AA12860C6 for ; Fri, 5 Jan 2024 05:05:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5619D5399; Fri, 5 Jan 2024 05:05:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rUdMMVXM" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 720BE5384 for ; Fri, 5 Jan 2024 05:05:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85BADC433C7; Fri, 5 Jan 2024 05:05:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704431131; bh=bDiPV3uyCW5UPugzq4bCJlkKgkGFl8NKchlqBqf/QT4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rUdMMVXMCmG1nuAMLxS0yIP7vE4rqe2372HxRHZ6kQSbiAMbrsN4S3wEGiej6i9dq x9srvxJ+dbKU1MKWATpZRRnC9VNxgnfVBcmlFMT/fkA/KXY6jj+FnHVmYcIaURj9bH I1Un5KMB0n8/almphcEIM474YEW6ucE5m4tmBa0tZ4U+kHmVHVH/s+iBMlzib1Sgu7 6ZM8mNFtqmQ+12U+rzHWpJbM0XRAm/mAsHdPBGjC5QRxUhhm/9LwQjkLMXRUBJcbs2 GDvMR9ZURZtxjq2oPfVJMJOIsbQvGnb6XPQuj+/pZyLK3+b16eFHTKwYr8915KqzN8 +CVFMJEpto6+A== Date: Thu, 4 Jan 2024 22:05:29 -0700 From: Keith Busch To: Christoph Hellwig Cc: Daniel Wagner , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Sagi Grimberg , James Smart , Hannes Reinecke Subject: Re: [PATCH v3 06/16] nvme-fc: Do not wait in vain when unloading module Message-ID: References: <20231218153105.12717-1-dwagner@suse.de> <20231218153105.12717-7-dwagner@suse.de> <20231219043514.GG30580@lst.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231219043514.GG30580@lst.de> On Tue, Dec 19, 2023 at 05:35:14AM +0100, Christoph Hellwig wrote: > On Mon, Dec 18, 2023 at 04:30:54PM +0100, Daniel Wagner wrote: > > The module unload code will wait for a controller to be delete even when > > there is no controller and we wait for completion forever to happen. > > Thus only wait for the completion when there is a controller which > > needs to be removed. > > This whole code looks fishy to me, and I suspect this patch only papers > over it. Why do we this wait to start with? If we've found that out and > documented it, the code really should be using a wait_event variant that > checks for the actual condition (no more controllers), because without > that you might still have a race otherwise. The synchronization here does feel off, but Daniel's change looks correct to the current implementation and is a minimal diff to fix it. Do you want to see this re-worked with a better wait condition or can we proceed with this?