Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp276175rdh; Mon, 18 Dec 2023 20:35:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IHtiWlT3EHLe6xEcn0n3LV5jch5gc2Cy/tfyotfvOwqCXIQt4xVUHIZh5oFqWPJW5O+LjQx X-Received: by 2002:a17:902:ea0e:b0:1d3:6c4d:8338 with SMTP id s14-20020a170902ea0e00b001d36c4d8338mr657318plg.52.1702960524868; Mon, 18 Dec 2023 20:35:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702960524; cv=none; d=google.com; s=arc-20160816; b=vSMSd1ECv+ZE9C5ur5FfjfzY/zG3/YS99ctvPDj77uh4JcGsldcCIUoeTwD4rO8/dN lFqFg+VVKr4cfV1c71alvSy3v/e9EAazZMBMgGO8woeuCLhG8LJ0cnAhF8N1X+Izyd+M h+oMAX7Kt0Cpsg0T1i9qiyEcokGReXTjs9GDbumceikTdqo3Q3BBFavewDGvUs5XBvI/ zSUr4jaGSe7/H4NojGXEy7COknfavs6+b2v8QYTdcNU6dDYghofEJWdqmkaOa0jaJUjZ Pgh/H5ao7Lxx/ViX4c33Jt5gp6YNv63tgwhCAEEh/lzbHSP/L6ld/HtxzQ0ZVWjPAEbx eeLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=2IZfAigx9EcvY5NMOTUVeagmZLzlgNCi6EVRH2R/igk=; fh=bO7QqOZggiuZIv2kiYKYk6++3Sxs5btaWVIXOG50Ggw=; b=ogwAbgQjH2F6K0Ps8RjcUDdi9Td5rFsOCeTVvDeDyfBPRvurRs9ltoV8D1MUxsCuRI NqnZ2RD2GWuI54zmj/ww0WNcZqzOWYm7uXlJL5H55kJj/WY8tupjwMhepFNN9SNTG7b0 l6lyXIP7L0jpr3ykcqMRZcPGd47WCCqbpb50uQ/LHaMlcPwWt0iN0YnLJuZyKaCIQCXq qBj7vS7LcCxcq6pH39D5De4Q5pJd1HiK+2UDp6X6TIG7WH3Vi0R6vL9zslP0uSw1YIIU g6areZ0/Gu5UcK/bfTSNSgSMhKWtk2aoBj0Tx6jsrHCI9QqTg7Dmc6vhyCL4CN1UVCgg pnEw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-4686-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4686-linux.lists.archive=gmail.com@vger.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 p9-20020a1709027ec900b001d00ed1187fsi18736356plb.116.2023.12.18.20.35.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 20:35:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4686-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; spf=pass (google.com: domain of linux-kernel+bounces-4686-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4686-linux.lists.archive=gmail.com@vger.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 6C8A8284FA5 for ; Tue, 19 Dec 2023 04:35:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C16BE6FC4; Tue, 19 Dec 2023 04:35:19 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (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 0D58963D1 for ; Tue, 19 Dec 2023 04:35:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id 4ED9668AFE; Tue, 19 Dec 2023 05:35:14 +0100 (CET) Date: Tue, 19 Dec 2023 05:35:14 +0100 From: Christoph Hellwig To: Daniel Wagner Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Christoph Hellwig , Sagi Grimberg , Keith Busch , James Smart , Hannes Reinecke Subject: Re: [PATCH v3 06/16] nvme-fc: Do not wait in vain when unloading module Message-ID: <20231219043514.GG30580@lst.de> References: <20231218153105.12717-1-dwagner@suse.de> <20231218153105.12717-7-dwagner@suse.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: <20231218153105.12717-7-dwagner@suse.de> User-Agent: Mutt/1.5.17 (2007-11-01) 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.