Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp298824rwb; Wed, 28 Sep 2022 02:55:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4deWx4e7u3DEVBwVZyKiVYD86BCy6f+ZIlJd9rAbcOnP37IkN8SGRyjpRu9nNHfSX750lY X-Received: by 2002:a17:906:6a0b:b0:783:1c53:a034 with SMTP id qw11-20020a1709066a0b00b007831c53a034mr15766029ejc.496.1664358927190; Wed, 28 Sep 2022 02:55:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664358927; cv=none; d=google.com; s=arc-20160816; b=W0EH6RmUiWhKMzlPGwKj35qlXOlQTW/9TN81aYx1FcPPctkHrhSpwHYQvoQ0P67MKI QhWtX5vxgAflx93mVB8dYQrx+X+sIAtzP1dZylZ5DTDrwAODQO43Bk4LSsX8LcnuNcn8 G+YmRwsxqfm70dG7ftPpCV2yOkMEg+FWYIMlQF7lG+tKclwKwkpnfOTRGxIQG3FI667Y cqum/rx4kd092NylEDfK3iqnQD4mjQ6mQv+UHfFUq9fLnY5NWxaiL/4PCtjTUlTaQ9Rc 9fEl2z6FWIyjXxv7nPWSPTgB4IBYV4ULeZ8hiv3Zy1t308y4XWy/L20V15xCEeAYAJit igiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=KibAYxnsw1nPnijaOJHw2QixkbiefJHPZPqELKlXBFQ=; b=cJc52vkO9P0sJS1opGZu/BCGYj6saqi/NWt8vBJ75GnVIgKtWYmG+lTz5t/BIHYYhP KK5Ms/sD/2/49IRh4nTE/Xpkmf3pSm1OMYBgHCfeTi7AQKgN9kUZPBe0BMiLeiUxCx+I wGQ/EQ0/5iKJe4QfzLX6oetzMnDLJxwu4/VfuCnNFQuQj3D2eZ5TnxoJEGXA+vwq/H5h qStHDhwH0E7atvk1kvl5dR/0YrkcU8WB0y251PkKwTZiFDSO67v9KeJvIbG+we75erRj kwIfouWfnldIuP10etJ3xKz/7OcJChDTT2d3vvzXEIfo/vHYNqzVoFqG2Mcpe8y7VP0P aJQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sc11-20020a1709078a0b00b00782a3405722si4210168ejc.40.2022.09.28.02.55.01; Wed, 28 Sep 2022 02:55:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233231AbiI1Jpz (ORCPT + 99 others); Wed, 28 Sep 2022 05:45:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233090AbiI1Jpw (ORCPT ); Wed, 28 Sep 2022 05:45:52 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3E5693537; Wed, 28 Sep 2022 02:45:49 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id DF05967373; Wed, 28 Sep 2022 11:45:45 +0200 (CEST) Date: Wed, 28 Sep 2022 11:45:45 +0200 From: Christoph Hellwig To: "Michael S. Tsirkin" Cc: Angus Chen , jasowang@redhat.com, pbonzini@redhat.com, axboe@kernel.dk, virtualization@lists.linux-foundation.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Liming Wu , stefanha@redhat.com, tglx@linutronix.de Subject: Re: [PATCH v1] virtio_blk: should not use IRQD_AFFINITY_MANAGED in init_rq Message-ID: <20220928094545.GA19646@lst.de> References: <20220924034854.323-1-angus.chen@jaguarmicro.com> <20220927163723-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220927163723-mutt-send-email-mst@kernel.org> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 27, 2022 at 04:47:20PM -0400, Michael S. Tsirkin wrote: > > The log : > > "genirq: Flags mismatch irq 0. 00000080 (virtio418) vs. 00015a00 (timer)" > > was print because of the irq 0 is used by timer exclusive,and when > > vp_find_vqs called vp_find_vqs_msix and return false twice,then it will > > call vp_find_vqs_intx for the last try. > > Because vp_dev->pci_dev->irq is zero,so it will be request irq 0 with > > flag IRQF_SHARED. > > First this is a bug. We can fix that so it will fail more cleanly. > > We should check pci_dev->pin and if 0 do not try to use INT#x > at all. > It will still fail, just with a nicer backtrace. How do we end up with a pci_dev without a valid PIN? Btw, that whole vp_find_* code looks extremely fucked up to me. The whole point of pci_alloc_irq_vectors* API is that it keeps drivers from poling into details of MSI-X v MSI vs INTX. > - because of auto affinity, we try to reserve an interrupt on all CPUs > - as there are 512 devices with a single vector per VQ we would > have no issue as they would be spread between CPUs, > but allocating on all CPUs fails. > > > I don't think the issue should be fixed at blk level - it is not > blk specifix - but yes this looks like a problem. > Christoph, any idea? I think this goes into the low-level interrupt vector allocator. I think Thomas is still the expert on it.