Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1124511pxv; Fri, 25 Jun 2021 06:05:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymMxfg4DkIS85i9Qgln463fb8pLmSadK7raRXNwE9RLWDpQQm1HuwIZyjW+4M2af/8M1zw X-Received: by 2002:aa7:cb19:: with SMTP id s25mr14794532edt.194.1624626326561; Fri, 25 Jun 2021 06:05:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624626326; cv=none; d=google.com; s=arc-20160816; b=GQjtUdia1BRPmVmF1wHBcPGWZ2fXcCrHd+xas6wqea7Uau+/+u+g0UU4vFMdhOWWHm VUBOUgjfNxlJJRi4DuUSMFZO+jydF/GFJOoRcMYfdaAF1VEicoWbZmXu8ood+pmYu6rZ q8t1YI/t9eEaSfm04hTL1g+K8SJ9P8kA8HomlYWY1MKmOnKSqeBd5uAxpqjb96uj/GPC ygZc+6RCRGYLMmkrBSHssbNxZmKhU3zuOJtjR4b7/GzF5waWK4DdfqSJsLccZ6oG0ojD RgBPMISVhDS1JjFTJNC8OgUcOd/+aMTcvVWMjh8znbTYju+nZo28xKg3ExeTx8eaR1I/ mGDA== 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; bh=B3OQ+6kMWXEqLkzrnVZadaNPJSKIMvnSIu0r7ijAo9w=; b=I1dPX7VGesckejUYspFKFcKy+NsMX0UJnBhajzNgwzHbAaCqMvRZnsm2WfM34FFWHl GY+6TMWMCbQ09pRzn7oM9gO/P6GLfOZZOzibGJQgb0EY3XZ2V5tWyCt8wKqBqmnXsSfa JVdPI0TkiCfkTYmJCadmoQbmV6BIq0zl2AV7Lco4eIijFG95YKwJNeCULuUYTHYncXXG QAFlk8X2QlT+OKCFqGP3lzLlEUZetjYgIEfXZccKEAsqOFXnJCVTveod7A1Ucfc3M7QF t6L5TgtapCLhukNGy9oed7l+O1V9AIgtglILvtqgQy2i8vy5IDJI65k5xbo9Hcya+rjZ qsrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AdaaYg2E; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hx8si5520049ejc.522.2021.06.25.06.05.01; Fri, 25 Jun 2021 06:05:26 -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=@redhat.com header.s=mimecast20190719 header.b=AdaaYg2E; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231585AbhFYNDC (ORCPT + 99 others); Fri, 25 Jun 2021 09:03:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:59553 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231386AbhFYNDB (ORCPT ); Fri, 25 Jun 2021 09:03:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624626040; h=from:from:reply-to:subject:subject: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=B3OQ+6kMWXEqLkzrnVZadaNPJSKIMvnSIu0r7ijAo9w=; b=AdaaYg2E8MlOmtNBZjQH3xNxu2GxaacwA6FPN/SaYyLXZqwdXxUEGn+UN7CnmZYQQQmZU0 JaP7ITnuzuf4SXFrHn5X3gPIPkkCFjmoijJGvYTnY70iJjii6ZkVO3QmTkpg2JFF5Cak8m eSOVybXreJGlKdgZB8etzP+5S0LG6dY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-512-17j0dxvzNJCKsipDIIqaXw-1; Fri, 25 Jun 2021 09:00:38 -0400 X-MC-Unique: 17j0dxvzNJCKsipDIIqaXw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2D44A802C92; Fri, 25 Jun 2021 13:00:37 +0000 (UTC) Received: from T590 (ovpn-12-153.pek2.redhat.com [10.72.12.153]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D3D09136F5; Fri, 25 Jun 2021 13:00:29 +0000 (UTC) Date: Fri, 25 Jun 2021 21:00:25 +0800 From: Ming Lei To: Daniel Wagner Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, James Smart , Keith Busch , Jens Axboe , Sagi Grimberg Subject: Re: [PATCH 0/2] Handle update hardware queues and queue freeze more carefully Message-ID: References: <20210625101649.49296-1-dwagner@suse.de> <20210625122156.x5yzoobuaaec5hss@beryllium.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210625122156.x5yzoobuaaec5hss@beryllium.lan> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 25, 2021 at 02:21:56PM +0200, Daniel Wagner wrote: > 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. Your patch just reduces the race window, what if all cpus in hctx->cpumask become offline when calling blk_mq_alloc_request_hctx()? Thanks, Ming