Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1616800imj; Thu, 14 Feb 2019 09:13:05 -0800 (PST) X-Google-Smtp-Source: AHgI3IZvIK9b3Y1eHWHe2K9m96Dq5RQh440FXhTEzalfeuvlClQkjUIhWDpJynrJ7X3k8DbMXDT6 X-Received: by 2002:a17:902:b686:: with SMTP id c6mr5129646pls.174.1550164385065; Thu, 14 Feb 2019 09:13:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550164385; cv=none; d=google.com; s=arc-20160816; b=DTgrXyod90QR4DtOLy2R2H9pLKxmiElHg3XZ25zh+v+QsfXLVfDrSGP9gMoz+pTx4q OndCyhveYgAIlhi3HsaXRtcBygpY9+I25QVcyZMH8kyyzrHJCn/xCo70yXUka/G4XGKq 3bu6eyU5LWA5GS9mQ+oN2fwW0NkLtnQ9s16ilfLxAZawuPEYmYx7W6+8pmZSQhFzJXUj h56KF1D8GhNoq2BC62JvZ11GgRRgUbr4siTy1xAAKTXktmBOYLkagaOYCNhiLIYUw2fU oTgFPSZOcgUjY/ukhSMN+qKYGZ/7C0qCgyeyBgLoceT3NWUwLZ5l3u18ZmAiUPL2ylbK qs5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=mmXE6uwjnocK+CBBJAiL0fXIalGwy0cfhs3fFIXekCY=; b=We04bY/FRQ4dyxlds012477uM/BBmhqqPp8S1m+T6CpE84GOPW/U8EY5X34A09ZN7E 4ejfkkqIobkpZzMf5eckLpOpAqAC/lUx+mjuGLcVLCtB3e60ASTQTUPeFq5mcYYxjDRq lqX01irpruBvSgbOhh5BelWmj4VcW33Jq38tbLXRTUfzNv0ns/QVTffECsYKkPqhzztX +J+SGYiuUyN9DbcZzEA0cAavfA+VgW94WCsiwesPVpDoPcfIzVQwJSqUxbp15dwDdpFK PmYDAjoW/AldFVqFZN6DL4bzSDnosABmIqpAn1DCBXcCzrXNhHyuuQIREeMCzh/RqyZ5 pLBw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c65si2929967pfe.202.2019.02.14.09.12.49; Thu, 14 Feb 2019 09:13:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437636AbfBNIue (ORCPT + 99 others); Thu, 14 Feb 2019 03:50:34 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:48930 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388475AbfBNIue (ORCPT ); Thu, 14 Feb 2019 03:50:34 -0500 Received: from p5492e0d8.dip0.t-ipconnect.de ([84.146.224.216] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1guCik-00008u-BE; Thu, 14 Feb 2019 09:50:14 +0100 Date: Thu, 14 Feb 2019 09:50:13 +0100 (CET) From: Thomas Gleixner To: Keith Busch cc: Bjorn Helgaas , Jens Axboe , Sagi Grimberg , linux-pci@vger.kernel.org, LKML , linux-nvme@lists.infradead.org, Ming Lei , linux-block@vger.kernel.org, Christoph Hellwig , Huacai Chen Subject: Re: [PATCH V3 1/5] genirq/affinity: don't mark 'affd' as const In-Reply-To: <20190213223711.GC8027@localhost.localdomain> Message-ID: References: <20190213105041.13537-1-ming.lei@redhat.com> <20190213105041.13537-2-ming.lei@redhat.com> <20190213150407.GB96272@google.com> <20190213213149.GB8027@localhost.localdomain> <20190213223711.GC8027@localhost.localdomain> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 13 Feb 2019, Keith Busch wrote: Cc+ Huacai Chen > On Wed, Feb 13, 2019 at 10:41:55PM +0100, Thomas Gleixner wrote: > > Btw, while I have your attention. There popped up an issue recently related > > to that affinity logic. > > > > The current implementation fails when: > > > > /* > > * If there aren't any vectors left after applying the pre/post > > * vectors don't bother with assigning affinity. > > */ > > if (nvecs == affd->pre_vectors + affd->post_vectors) > > return NULL; > > > > Now the discussion arised, that in that case the affinity sets are not > > allocated and filled in for the pre/post vectors, but somehow the > > underlying device still works and later on triggers the warning in the > > blk-mq code because the MSI entries do not have affinity information > > attached. > > > > Sure, we could make that work, but there are several issues: > > > > 1) irq_create_affinity_masks() has another reason to return NULL: > > memory allocation fails. > > > > 2) Does it make sense at all. > > > > Right now the PCI allocator ignores the NULL return and proceeds without > > setting any affinities. As a consequence nothing is managed and everything > > happens to work. > > > > But that happens to work is more by chance than by design and the warning > > is bogus if this is an expected mode of operation. > > > > We should address these points in some way. > > Ah, yes, that's a mistake in the nvme driver. It is assuming IO queues are > always on managed interrupts, but that's not true if when only 1 vector > could be allocated. This should be an appropriate fix to the warning: Looks correct. Chen, can you please test that? > --- > diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c > index 022ea1ee63f8..f2ccebe1c926 100644 > --- a/drivers/nvme/host/pci.c > +++ b/drivers/nvme/host/pci.c > @@ -506,7 +506,7 @@ static int nvme_pci_map_queues(struct blk_mq_tag_set *set) > * affinity), so use the regular blk-mq cpu mapping > */ > map->queue_offset = qoff; > - if (i != HCTX_TYPE_POLL) > + if (i != HCTX_TYPE_POLL && dev->num_vecs > 1) > blk_mq_pci_map_queues(map, to_pci_dev(dev->dev), offset); > else > blk_mq_map_queues(map); > -- >