Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp3108087lqo; Tue, 21 May 2024 07:10:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV6TRjJZ2rESsH3g2ZCSfnDVlaHwZSDCy70cjSuBGKBt95KRYfXhyG7Kz3E47p/83bXPBHvZRq75OmJ5ZBOGcdyoPQKygb4cUe0aOOYBA== X-Google-Smtp-Source: AGHT+IGJ79R05clzGgHJEpcAL5MED0yT5qCK1Wlyk+yMl+WOJzBnBf1HNlkkH5WfavMD6/BSqCmF X-Received: by 2002:a05:6830:4490:b0:6f1:2309:c709 with SMTP id 46e09a7af769-6f12309cbaemr27403798a34.28.1716300651871; Tue, 21 May 2024 07:10:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716300651; cv=pass; d=google.com; s=arc-20160816; b=F8FvFLQSDxSdjihzzkyjT09c57rm4LhRvhzgEamEMVJe4xqWp/I+1Ig8sXzIn8TPvO +qR2Q7+IwSuscgfJ4+KPf2D/kxs7Gj1n+4N9EceVLFMiCuZC9+ny7mpXqD3UT46vFv7R gZByaja1HIH4zqrp4etYfShdkPTfr7JS/K6yDJzObldTTmye+1QSBWvrAG3f8l2vRKp6 FGaclcmbAfx0t6h5vbQoA3yATea/eu6JvH06VO9Vh//GZavIgKs3lGYDgJ/p34GWvtT6 yshoNRdlqLm2m1hO3krnDapcc2kuIClv+TJsB33HPznuelmC5TscKd05sBaZ5eVEzAim bLbg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=WHkUC5sP2LvL+1U2WFSY7SrHAxZF/q3GgQcTVU8ixR8=; fh=OlsHl1p3V5iUreEpgHun9oq42SvkAyevvC+Fb3UkErw=; b=eIuqtA0YioXcMVFaU2Rfz0QRWg6blF7XMZ9gDBa1+QSXMS3H1rIsli7rzSg9chGh3A rmiKnFuIUOTT5MGsb3kZNJeWxv8cUnJqxC/EcYMhsJHDaORH7RkOmpGHSyL3k6LajPG+ 2BkU7IDpDgifco8SkOHhlYW/urRrX8IQRzDkNksV6YNS0qDQu66rMKGQhZZadJB1ghtk OwhHFJlnAQgSygiEnxQXYvMLu5fYAiZ0n3fnyUYpagdZznhvZnlIzR5px4fNMXc4HcTH HKD3icr+4sEB5+MnJfC7rbKpxhrBz+OlGh95EIMIxOWIsr14k9tHiuOBx9+uIXQQ1g6X gGPg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Jt7rX7V8; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-185065-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185065-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ada2fe7eead31-48573a22546si2379852137.472.2024.05.21.07.10.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 07:10:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-185065-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Jt7rX7V8; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-185065-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185065-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 5048B1C23050 for ; Tue, 21 May 2024 14:10:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4B0507F7C1; Tue, 21 May 2024 14:10:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Jt7rX7V8" 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 71F96535B7 for ; Tue, 21 May 2024 14:10:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716300621; cv=none; b=lUSt/lfbC9s8YLPyft/+72wklkt2ufnyA2J09igM8aPam/BFBDJZ8bXwYpAI1YsRxK2LLzQT4mQuJ4Jp+xandZwvTV6E2n4AFyfqmENTFRoUauJeRFEJXJ2xHc3wfymDBKdKQIQKlvB3ow/C/6Fa2uMHnurZavt3FIpmxeM5dnM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716300621; c=relaxed/simple; bh=amWnjt4JjeCxkbq0DcmeXrYrb3QX2mJNLgyTI5kZlMg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Fxz/WL0BpJzXWppXKGn1yAUgd6bUPJ5/tcN7eKv1XSDgn3PX81tssy4Pf8yXO0PpVlxPOQppGi06DZdpgwxPefUTiDIrq7DnJ+1t4PjYFVVzm7u60lfcsESVLvjumXzhrDGgoYX4uuK2mRCTGOO6DSrqKJnlViWPJxbpJm8tV+s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Jt7rX7V8; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8DC87C2BD11; Tue, 21 May 2024 14:10:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716300621; bh=amWnjt4JjeCxkbq0DcmeXrYrb3QX2mJNLgyTI5kZlMg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Jt7rX7V87jSD6Pg/RJE+R+B+xHXjLuKsp7h91efnNLo9h9dCsX9mUCF9mvWRfzv7b hRFiibRtI9BqRKbgP7fN12FIOa2sSx/qeC++FlkL9c6RVGAi5j9xsAoAgGFfF41tCN hfNU2jjvFlwMSu2bNL3A9Yi7jmMGXdLLxZ5LgfsLXjMeivPKjy9vYJGYNQeOwdaNKp PnXzASPuvJUcnjeHpQF6q4vqyNhrSjIVSkv8TJl8ZoNSeDEG2rwatv6b1r82UeXFDw DXXjMzOz+vgS2wXujor3bQFJOuGK/bVZ50BFHvGKSPk+dbwAxIaxNJrCKK76u2rR1e Nx0E71iXijzgg== Date: Tue, 21 May 2024 08:10:18 -0600 From: Keith Busch To: John Meneghini Cc: Hannes Reinecke , hch@lst.de, sagi@grimberg.me, emilne@redhat.com, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, jrani@purestorage.com, randyj@purestorage.com, hare@kernel.org Subject: Re: [PATCH v3 1/1] nvme: multipath: Implemented new iopolicy "queue-depth" Message-ID: References: <20240520202045.427110-1-jmeneghi@redhat.com> <20240520202045.427110-2-jmeneghi@redhat.com> <595e5988-b94d-41ba-a233-f87aed55028d@redhat.com> 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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <595e5988-b94d-41ba-a233-f87aed55028d@redhat.com> On Tue, May 21, 2024 at 09:58:31AM -0400, John Meneghini wrote: > On 5/21/24 02:46, Hannes Reinecke wrote: > > > +??? list_for_each_entry(ctrl, &subsys->ctrls, subsys_entry) { > > > +??????? atomic_set(&ctrl->nr_active, 0); > > > +??????? nvme_mpath_clear_ctrl_paths(ctrl); > > > > You always reset the variables here, even if specified iopolicy is > > the same than the currently active one. > > I'd rather check if the iopolicy is different before changing the settings. > > Yes, Keith pointed this out too. This is actually a feature not a bug. In > situations were we want to "reset" the nr_active counters on all controllers > the user can simply set the queue-depth iopolicy a second time. I don't > expect users to do this very often... they shouldn't be changing IO policies > back and forth too much... but the ability to "reset" the nr_active counters > during testing has been very helpful and important to do. So I'd like to > keep this. Moreover, this is NOT the performance path. I don't see the > point in making performance optimizations in a code path that is run once a > year. I missed that you actually want to reset the counters on a live queue. Wouldn't that just lead to an imbalance? If that is really a feature, then I retract a previous comment: you do need the atomic_dec_not_zero (or whatever it was called) since the active count is no longer tied to the inc's.