Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1091627pxv; Fri, 25 Jun 2021 05:24:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/wjFFCD9FZ2JeahQDn08MLbTQUWAIE/Dq9u9I1VTeuleB9vChNGaA6z0Xx4tEvbZEJzH3 X-Received: by 2002:a02:a916:: with SMTP id n22mr9376843jam.110.1624623847809; Fri, 25 Jun 2021 05:24:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624623847; cv=none; d=google.com; s=arc-20160816; b=Y8lyj86XgGrNd2f5Iq80x9KvTndS/I7yNxD0i5bYbl2zc3wRLsL4L4VqBccOIkoAY+ JXi5tXk9DToaea68IDFxGxwCbr8ht1stY9JGE/TY68A8hJDZgxNC9PS4WRAmy9GyrgRt BevUYacD/1XQS7hppBdUChb32Ftk2EpDrClWhKYnxDJhCK0QqrzoEInN7iXRxs62gBRV yLig6tmpnooBtX4Bu7eO3sI8HGUh7u4vhLYQNIdsVZ1LXP8Wyi55I18O66lvgIXdth8u hNGDdkUsjReF7aj1AWZPcRBj4lruxI2Ca6pf9gFsgRqL4uJhwuOyYE/+P+dsgteNOIeA 3Zlw== 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:dkim-signature:dkim-signature; bh=pAj1upETTIyHAZ/PkSRbshacc33JaBnwwpRJoNDa32c=; b=p96sU6BFnT1Ltt2Jmk2aZ44JMep+DtHuLp4rLIALyiiWws/k0VjCJuzkwUVFwrtrpR 0/eFep1rtf7vHKJNUl8toN/nCtxt13ObXv/u0DGmDsDeHLSnoipw/ugKC4QtWKwrIzJu NuHaCPdmasz8sjSfd/qVWyiZGCr9oi00kKNidWiTyEb0Zu0/rHwbjuwTs+nLZm2IPWOd lMjp7wtGnkxv3VGlWLiM4m6UCqVwHDEQR1O+ZV4oXLP6P+SPrnjd5G94Trv8wz+MqMZw nbsfny6+K7kv0pXu9NIvtdHIU7hDhtZEkUSOZNkRbBq0PvTnfwGWnK/n3ETkNOvkLKFJ 6ZkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=xyc6A4xc; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=kfcmTV4m; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=xyc6A4xc; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=kfcmTV4m; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b11si8048432ilv.25.2021.06.25.05.23.55; Fri, 25 Jun 2021 05:24:07 -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=xyc6A4xc; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=kfcmTV4m; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=xyc6A4xc; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=kfcmTV4m; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230270AbhFYMYU (ORCPT + 99 others); Fri, 25 Jun 2021 08:24:20 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:45434 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbhFYMYS (ORCPT ); Fri, 25 Jun 2021 08:24:18 -0400 Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id D04B421C99; Fri, 25 Jun 2021 12:21:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1624623716; 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=pAj1upETTIyHAZ/PkSRbshacc33JaBnwwpRJoNDa32c=; b=xyc6A4xctkd1tWu+GXqPEdu8UDgKldkATgON6UUtpNfDsstz8y7+RMNMAPpMdKgiD/Koce F8x6TQD1OA2Geetl2U4zF2ZnQNM82njAjVvey26iyUOURCUX2JRuXuoNFTO0BliMlAZ0vq XmkRALVOoiaGm9frJudpdSZvVXlMy6A= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1624623716; 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=pAj1upETTIyHAZ/PkSRbshacc33JaBnwwpRJoNDa32c=; b=kfcmTV4mrN8XaQoL843ZMEYuw2Xgtc3ZZTjlz7IJmlEXmhN0pJSl7OlAy4Lk/v/iW5Cwjs X1lvSo5naec9mnCQ== Received: from imap3-int (imap-alt.suse-dmz.suse.de [192.168.254.47]) by imap.suse.de (Postfix) with ESMTP id BEB6511A97; Fri, 25 Jun 2021 12:21:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1624623716; 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=pAj1upETTIyHAZ/PkSRbshacc33JaBnwwpRJoNDa32c=; b=xyc6A4xctkd1tWu+GXqPEdu8UDgKldkATgON6UUtpNfDsstz8y7+RMNMAPpMdKgiD/Koce F8x6TQD1OA2Geetl2U4zF2ZnQNM82njAjVvey26iyUOURCUX2JRuXuoNFTO0BliMlAZ0vq XmkRALVOoiaGm9frJudpdSZvVXlMy6A= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1624623716; 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=pAj1upETTIyHAZ/PkSRbshacc33JaBnwwpRJoNDa32c=; b=kfcmTV4mrN8XaQoL843ZMEYuw2Xgtc3ZZTjlz7IJmlEXmhN0pJSl7OlAy4Lk/v/iW5Cwjs X1lvSo5naec9mnCQ== Received: from director2.suse.de ([192.168.254.72]) by imap3-int with ESMTPSA id /xKJLWTK1WBmRQAALh3uQQ (envelope-from ); Fri, 25 Jun 2021 12:21:56 +0000 Date: Fri, 25 Jun 2021 14:21:56 +0200 From: Daniel Wagner To: linux-nvme@lists.infradead.org Cc: linux-kernel@vger.kernel.org, James Smart , Keith Busch , Jens Axboe , Ming Lei , Sagi Grimberg Subject: Re: [PATCH 0/2] Handle update hardware queues and queue freeze more carefully Message-ID: <20210625122156.x5yzoobuaaec5hss@beryllium.lan> References: <20210625101649.49296-1-dwagner@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210625101649.49296-1-dwagner@suse.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 25, 2021 at 12:16:47PM +0200, Daniel Wagner wrote: > this is a followup on the crash I reported in > > https://lore.kernel.org/linux-block/20210608183339.70609-1-dwagner@suse.de/ > > By moving the hardware check up the crash was gone. Unfortuntatly, I > don't understand why this fixes the crash. The per-cpu access is > crashing but I can't see why the blk_mq_update_nr_hw_queues() is > fixing this problem. > > Even though I can't explain why it fixes it, I think it makes sense to > update the hardware queue mapping bevore we recreate the IO > queues. Thus I avoided in the commit message to say it fixes > something. I just discussed this with Hannes and we figured out how the crash is fixed by moving the blk_mq_update_nr_hw_queues() before the nvme_fc_create_hw_io_queues()/nvme_fc_connect_io_queues(). First of all, blk_mq_update_nr_hw_queues() operates on the normal tag_set and not the admin_tag_set. That means when we move the blk_mq_update_nr_hw_queues() before the nvme_fc_connect_io_queues(), we update the mapping to only CPUs and hwctx which are available. When we then do the connect call nvmf_connect_io_queue() we will only allocate tags from queues which are not in the BLK_MQ_S_INACTIVE anymore. Hence we skip the blk_mq_put_tag() call. > Also during testing I observed the we hang indivinetly in > blk_mq_freeze_queue_wait(). Again I can't explain why we get stuck > there but given a common pattern for the nvme_wait_freeze() is to use > it with a timeout I think the timeout should be used too :) The nvme_wait_freeeze() is probably not needed at all, __blk_mq_update_nr_hw_queues() already calls blk_mq_freeze_queue(). So there this is not needed at all. Furthermore, if we move blk_mq_update_nr_hw_queues() in front of nvme_fc_create_hw_io_queues() there can't be any pending I/Os because there are not queues.