Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5174818rwl; Mon, 3 Apr 2023 15:53:09 -0700 (PDT) X-Google-Smtp-Source: AKy350aPry8bUBgvtfFPIwUf5ZwcAjxJ+7+upqDKJwQufAaXYW2z8jKs7pELTY4dTY1NeEqPIPDE X-Received: by 2002:a17:90b:4a4a:b0:240:59e8:6dad with SMTP id lb10-20020a17090b4a4a00b0024059e86dadmr441886pjb.25.1680562388905; Mon, 03 Apr 2023 15:53:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680562388; cv=none; d=google.com; s=arc-20160816; b=VS12MAVqJEWbzzsnwOBXq0BhSLZ6M+kjpZZYal3gYtU33V5z/SGLSrtMH0pG6jgODz 3CVSh6k7o3Gj7QgGCAcSRIrUr5PFZfT+r3UDXZzJHW2mi5i7fO5RIsudopTTIIeFiLJx TqOm4mzZOiFQYO0Dc699/YJDz7/Hk28yQcuj87ekevOVs0a632QmBdA27lW4amy9p57q WJbeQpkYRqc1o++/7/xvgqzQHmcwvRxbUf19SbM6sI8gjKi0lcoZLG/opOeaTfoQGXOC B0lLlyMUMnGnH4owr036yQhGuhxXPVKRMTdjAgBDfthskiRWZDEuayCORNK5LedinwbN tE/A== 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-transfer-encoding :content-disposition:mime-version:message-id:subject:cc:to:from:date :dkim-signature; bh=dYr90phtLBRWcuY571rSxAxQYKQJRhVv8wNfU74PlJ8=; b=aC8yu8xOonQzaguKbemaV9IOq1dXmJX9x0hrXILRmEN+FJld0HdO7j8gXJrRJPeQr2 3xKE9jWDkYSp8veYIumIO7GTMzbVt4pxMidxRqY81weVF9LhdGDneNQ/+fBCPkwWEevg QyC+WBvoR1zC2WNnBnuxNhWKrkZ5VxSnt1evXa9956gVjh8zcl4s9BWRY4hz1kYYl4T+ 68+jfO4LQxWr4S2a3y6AYLBIiDnqgHTt1PcloBhDnbm6yTIa9kEdi/tKoq2OxA9S3ZbY xfOX9ztDMGJPRZ/hCGe4265tQD0NgeQpKbpRkZglbveBpACZI/rixojrXgGNDFAnZ/E4 JUFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gYKvx2yQ; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x4-20020a17090a8a8400b00240e633e032si7444192pjn.8.2023.04.03.15.52.32; Mon, 03 Apr 2023 15:53:08 -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=@kernel.org header.s=k20201202 header.b=gYKvx2yQ; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233492AbjDCWpW (ORCPT + 99 others); Mon, 3 Apr 2023 18:45:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232662AbjDCWpV (ORCPT ); Mon, 3 Apr 2023 18:45:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61D0F4229; Mon, 3 Apr 2023 15:45:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EC11B62CE9; Mon, 3 Apr 2023 22:45:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0FEF4C433EF; Mon, 3 Apr 2023 22:45:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680561919; bh=6UNv3+eqSlkCVjZETzDidbfpnJbVpxsshChed0Ya4sk=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=gYKvx2yQmRk0QKdVmq6TZO2J9ADw/a5+B90W63mY2lDs9d0TittJCvPYJordwOYQx pNDwp04ym5zv/Yg+Drvr9bIzhdVt9/X98hC9zq/v9NG2hDnjxS0wFao7VLVGr5r/0v ieRNiS9GSSel464YmlE5nYW+QtcMAEhGvTnTcfKsefTNYicWRTm6y61QJ6Sux9w+u8 G5bkeu2bTulBTjVu3taqegj/PVyIlhz7Dx+bN+VOpar931ecw4j4aOjpjHsciHp5ew a3u1Wx7qM+dQRLL07TcaqyF8b+Vw/E1JAO8sNHWZbjMZFM+B+4IMCPV1pJMXPBCsTG GPziX4oAmQolA== Date: Mon, 3 Apr 2023 17:45:17 -0500 From: Bjorn Helgaas To: Xinghui Li Cc: nirmal.patel@linux.intel.com, kbusch@kernel.org, jonathan.derrick@linux.dev, lpieralisi@kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Xinghui Li Subject: Re: [PATCH v4] PCI: vmd: Add the module param to adjust MSI mode Message-ID: <20230403224517.GA3472913@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS 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 Sun, Apr 02, 2023 at 11:02:07PM +0800, Xinghui Li wrote: > On Thu, Mar 30, 2023 at 12:31 AM Bjorn Helgaas wrote: > > On Wed, Mar 29, 2023 at 04:57:08PM +0800, Xinghui Li wrote: > > > On Wed, Mar 29, 2023 at 5:34 AM Bjorn Helgaas wrote: > > > > It would also be nice to include a hint about why a user would choose > > > > "on" or "off". What is the performance effect? What sort of I/O > > > > scenario would lead you to choose "on" vs "off"? > > I don't think we need detailed performance numbers, but we need > > something like: > > > > - "msi_remap=off" improves interrupt handling performance by > > avoiding the VMD MSI-X domain interrupt handler > > > > - But "msi_remap=on" is needed when ...? > > > In the patch I send in last email, We speculate that the VMD > Controller aggregate interrupts, > making the PCIe port less stressed and improving iops. In this > case(lots of 4k random IO), if we enable the VMD MSI > remapping, we found the interrupts from VMD Controller's MSI are less > and the IOPS is much higher. Great, that's useful information about why users would want to use this parameter. Obviously the other half is to mention the reasons why they may not be able to use it. If "msi_remap=off" were *always* safe and desirable, we would just do that unconditionally and there would be no point in a parameter. > > > I place the "vmd_config_msi_remap_param" that is VMD MSI-X's mode > > > param configuring helper front > > > "vmd_enable_domain". So, It will not change the logic disabling > > > remapping from ee81ee84f873, such as > > > "Currently MSI remapping must be enabled in guest passthrough mode". > > > So, if the user config the wrong type, it will not work, and they can > > > find it by dmesg. > > > > That's kind of a problem. I'm not in favor of something failing and > > the user having to debug it via dmesg. That causes user frustration > > and problem reports. > > What about adding a sysfs node for it in VMD PCI bus dir, which allows > users to catch VMD's MSI current working mode? No, a sysfs node is not the answer to this. If we *can* avoid a non-working situation, we should avoid it. If users see a non-working situation, they will rightly complain, and somebody will have to debug it. We don't want that. > > I don't know what "guest passthrough mode" is. Can you detect that > > automatically? > > I quote this from the commit ee81ee84f873's comment, it can be detected by the > logic like this: > if (!(features & VMD_FEAT_CAN_BYPASS_MSI_REMAP) || > offset[0] || offset[1]) > I just want to answer your comment: "There's also a hint that some > virt configs require it." > This patch will not modify the logic of determining whether MSI > remapping is enabled > when running VMD in Guest. My point is that apparently guest passthrough mode is relevant and maybe it should be part of the commit log about how this parameter should be used. Bjorn