Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp359044rwb; Wed, 28 Sep 2022 03:51:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM79+OPLAF/NI3qwaeEEhYQuBVk4XeEI8umeBMgIZuQ0mxmtSyxuDZuKARHOZ1yXrAnzk9JB X-Received: by 2002:a05:6402:4148:b0:440:cb9f:d10f with SMTP id x8-20020a056402414800b00440cb9fd10fmr32639744eda.77.1664362261079; Wed, 28 Sep 2022 03:51:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664362261; cv=none; d=google.com; s=arc-20160816; b=IJbkeWNd6pZQOrJGPvQh0ShT3+FUB6SWAihPA0fBps8e/ADpD6y+C7mNm2bP4oFk2U 03QvmqbuKDIBB795/Zvk0fL/XK59xF2sfnzHTflaJOePb1QaVqPvCPuwSa2mq08VdM7K nwycuqgoRO3J1jf+pU6zcUPGdQcMEA8liAd1mE8Kv4szLikiYA6P9GnOZXkq0Iv/iTQk jJJmoiX0j3ypuxeGvNs+ymEKXn7Jp1vBmvGS0N8/SXFOJIRRnamlrjuNIetFyK8k4Vmy zCfg+JySVYeaUE5w07WhNWzXmLRfGWGk0WxJx7jMh6DsmNSfHB4bfDB22SAwfyQABHsd p39Q== 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=uGN/gn+YJZ4VIu5yaP7PXBIwmM0Ss1jImh/D5mV3zS0=; b=NSE87iEHUhOw3a5Lo8/AvokVtAJzKGOWdpZ73PjnZ0nojRhsjCvHIy8pmt8qaw6Lwz 31KavIrFDR40yOGKREUISEa/a+lwM8QNOPiIRbPnJCnQxSNW5BihEqFeGSLPXL0HbiCk yGqHE2ewQlwUzg/8njJGHlS5kFKDJkl02FKt2JWwpIClsMZscijB7LRASb+40Met1bU3 +cr803D8CT3iBPp0HCu7M/gjOnRjHiGroHZAcjwear1ofC6hguQsAI7rd2cUvdkWVhj0 iz0vocNxwd/0+6QsyW34eUDS9Gfo0f3bmSWAJpX3eeBAbwQIQGe8sbRZWvO5mFTucf/z 9d+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YLR5qZwW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id du1-20020a17090772c100b007814ff4ce25si4373322ejc.285.2022.09.28.03.50.34; Wed, 28 Sep 2022 03:51:01 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YLR5qZwW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233934AbiI1KEL (ORCPT + 99 others); Wed, 28 Sep 2022 06:04:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233548AbiI1KDm (ORCPT ); Wed, 28 Sep 2022 06:03:42 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BCB6F1D44 for ; Wed, 28 Sep 2022 03:03:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664359394; 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=uGN/gn+YJZ4VIu5yaP7PXBIwmM0Ss1jImh/D5mV3zS0=; b=YLR5qZwW23DTerVqwkrNXEow/mMw1EyIJ+zmpstf05xcEjlfnV06FjEHRisXSgs5yLjJMr mNj+FE+F1ISuxHigp27nUdfXvHGWPZl1TmSqDdfcO6JBUO+UL81MfYPfTAtUTarmmTxnZv Bc//qWIEqQo9AD5wTLU0EfGrXI/0QG4= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-633-4ZLEbh9GPHirM-J-QBuZ9Q-1; Wed, 28 Sep 2022 06:03:13 -0400 X-MC-Unique: 4ZLEbh9GPHirM-J-QBuZ9Q-1 Received: by mail-wm1-f72.google.com with SMTP id i129-20020a1c3b87000000b003b33e6160bdso922945wma.7 for ; Wed, 28 Sep 2022 03:03:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=uGN/gn+YJZ4VIu5yaP7PXBIwmM0Ss1jImh/D5mV3zS0=; b=vHdJjF5kCIcCKCEpyA3AoxAJl3c1IxKY0HInitX8MLY+4tUB6z6Emilk4+YlW9O+Zw kT9t6zbhuaYWbFpvwZ/Oj5OsXcECKJIC54RvsVFZYmRHrTr+/n4SXHOfLJ6/WzNYFY7z RvFSiEbqJkoABnl3em9MISttfV8j15LEdmjSZFVQYTc8swKU7DPJ0nCrR/3q8TtmloUh m4cSX094kSwPUsFcCDbfUiMWdl54Z03RdyQg2vPx4Hyzm4n3PUKMP2SY2iprkKuaCTGD FudpVV9kmGv95S/7LsBvFCgYj1o9EH9ymKzxSL4WRplAx7fd1NSly9kmyOwFP5VBcCQ0 n1Fw== X-Gm-Message-State: ACrzQf0J38NtjwdFQw1wvp8TR1Xc9tdbjerZRk/IgX28Og7DWv2giYAw FnGykLnwbhg+ioW6yubMCl4JMg7bi4DkvsJKzF702h64ooYAHeYlhYkCSJrU1ZfOFAx1sjVXa1O zY7w59UXwH3pYVuPBoxiZkyG1 X-Received: by 2002:a05:6000:1845:b0:22a:4b7a:6f55 with SMTP id c5-20020a056000184500b0022a4b7a6f55mr19857125wri.288.1664359392583; Wed, 28 Sep 2022 03:03:12 -0700 (PDT) X-Received: by 2002:a05:6000:1845:b0:22a:4b7a:6f55 with SMTP id c5-20020a056000184500b0022a4b7a6f55mr19857103wri.288.1664359392370; Wed, 28 Sep 2022 03:03:12 -0700 (PDT) Received: from redhat.com ([2.55.17.78]) by smtp.gmail.com with ESMTPSA id q16-20020adfcd90000000b0022cbf4cda62sm4051657wrj.27.2022.09.28.03.03.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Sep 2022 03:03:11 -0700 (PDT) Date: Wed, 28 Sep 2022 06:03:07 -0400 From: "Michael S. Tsirkin" To: Christoph Hellwig 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: <20220928055718-mutt-send-email-mst@kernel.org> References: <20220924034854.323-1-angus.chen@jaguarmicro.com> <20220927163723-mutt-send-email-mst@kernel.org> <20220928094545.GA19646@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220928094545.GA19646@lst.de> X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 Wed, Sep 28, 2022 at 11:45:45AM +0200, Christoph Hellwig wrote: > 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? This patch is broken but there's no v3 which looks right, and includes an explanation. > 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. Poking? I think that code predates that, a minimal change was made to support affinity... but again, it does not look like the main issue has anything to do with that. Or maybe I'm wrong ... > > - 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. syzbot is also telling us there's an issue in next (and not due to virtio changes - I intentionally removed most of them for a while and the issue was there) but I could not figure it out. -- MST