Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1401254pxb; Fri, 20 Aug 2021 04:56:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWAwQI3VZ84y++e/LKBrT5b7LVBS/eNfwbiViDrHaRPTCjxaTjZmm8Ate9fPx6jA9VkC1P X-Received: by 2002:a5e:d918:: with SMTP id n24mr16221398iop.173.1629460575727; Fri, 20 Aug 2021 04:56:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629460575; cv=none; d=google.com; s=arc-20160816; b=XvOpc8fkl0wGqOTffRjSHUz78HBkk8lhBnrqb8q5e8ju8mLMhqe/KbzB+dBrI+akB7 ENNPxkDRPjeu6R8vqGFemeKByQG2UpmWf1ckX3GtmY0407XGFlMoDGRa9rIjvg9YLynB 9f7Dw223a0uQPPNZy6tiyhKtLvR0rJ8z3HT6pavqjN8NJT0JuMb1MA3t6TYJw8hf3Apw WeghCLLscSAmAD1+2ghz6tYsBdPihA2hWQ8+TUESEtIfuWHzJTZ+So51yGYQIs8Uf4fB N+0iUpRviKE/UGvbf2GlRf24S3ZaDzCpEjrNBM1OM6HHLaC5Szxwl5YU0nSfAusbMd9k qQLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=TO8SPS42MqtUgER5AvlMEomQQplZq9qOHXpgo20Scrk=; b=v5JX8Km08aX0QdXLWCpCiUCf15T969EPVlK0uj/zlTYIlR7/k9XjHcCHXKtHltqjHw IGrcLzW5tlPNxIiy0N9Sd880Rw/8tUgiPAo1fQORtDkfDwWnxs7eH/T96nGj3G0PXhcm N9olH77TYxUuiC3AIL1T7+Z0lTjiOm4Md5A164SXvuA8uMU5dGJcnahgXrmLdwiGhiUu x9/eiF3D9kb+dabL8kFAPZqGgWjkoWp1TRqQLVHzUT1DX5tx7hbEMKNY0aSHxYTm8FTk 4dSgsMKPiQa3UaSVPkJ05J9csiFpQZiOgJAqOZHyJ/FMo2YnAI0Rju4E9PkBA2ehCBnX +C9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=kvs9bcNG; dkim=neutral (no key) header.i=@suse.de header.b=5knjeyv2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p14si6624063ilo.31.2021.08.20.04.56.03; Fri, 20 Aug 2021 04:56:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=kvs9bcNG; dkim=neutral (no key) header.i=@suse.de header.b=5knjeyv2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238179AbhHTL4A (ORCPT + 99 others); Fri, 20 Aug 2021 07:56:00 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:49768 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237639AbhHTL4A (ORCPT ); Fri, 20 Aug 2021 07:56:00 -0400 Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id B4EFD21F55; Fri, 20 Aug 2021 11:55:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1629460521; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=TO8SPS42MqtUgER5AvlMEomQQplZq9qOHXpgo20Scrk=; b=kvs9bcNGubJH4ZnJkboxY/xli6iMNsaCm9srblPmUkUp9bC61imZQDz4eoQ3zMo70Obwxr yiFSOR4f56RmogCgx80MArxynga3Hs/FwILY6MmbWN1PHUn6nZI9QC9yKzCgvUKjZUVJrZ kUHGfJSPRAHm4k2doOCQgU9fsscS1EE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1629460521; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=TO8SPS42MqtUgER5AvlMEomQQplZq9qOHXpgo20Scrk=; b=5knjeyv2pt/rSDf5q/9BS8fw8r+GScRhnWksQVbjUEnaQs7QCbHyk0CUNP1cSr2fXQIiio 3wY3MN9CMPgpIeBA== Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap1.suse-dmz.suse.de (Postfix) with ESMTPS id A388D13AD0; Fri, 20 Aug 2021 11:55:21 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id tSOtJymYH2FIfgAAGKfGzw (envelope-from ); Fri, 20 Aug 2021 11:55:21 +0000 Date: Fri, 20 Aug 2021 13:55:21 +0200 From: Daniel Wagner To: linux-nvme@lists.infradead.org Cc: linux-kernel@vger.kernel.org, James Smart , Keith Busch , Ming Lei , Sagi Grimberg , Hannes Reinecke , Wen Xiong , Himanshu Madhani Subject: Re: [PATCH v5 0/3] Handle update hardware queues and queue freeze more carefully Message-ID: <20210820115521.alveifzvad3zuwh4@carbon.lan> References: <20210818120530.130501-1-dwagner@suse.de> <20210820084832.nlsbiztn26fv3b73@carbon.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210820084832.nlsbiztn26fv3b73@carbon.lan> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 20, 2021 at 10:48:32AM +0200, Daniel Wagner wrote: > Then we try to do the same thing again which fails, thus we never > make progress. > > So clearly we need to update number of queues at one point. What would > be the right thing to do here? As I understood we need to be careful > with frozen requests. Can we abort them (is this even possible in this > state?) and requeue them before we update the queue numbers? After starring a bit longer at the reset path, I think there is no pending request in any queue. nvme_fc_delete_association() calls __nvme_fc_abort_outstanding_ios() which makes sure all queues are drained (usage counter is 0). Also it clears the NVME_FC_Q_LIVE bit, which prevents further request added to queues. I start wonder why we have to do the nvme_start_freeze() in the first place and why we want to wait for the freeze. 88e837ed0f1f ("nvme-fc: wait for queues to freeze before calling update_hr_hw_queues") doesn't really tell why we need wait for the freeze. Given we know the usage counter of the queues is 0, I think we are safe to move the blk_mq_update_nr_hw_queues() before the start queue code. Also note nvme_fc_create_hw_io_queues() calls blk_mq_freeze_queue() but it wont block as we are sure there is no pending request.