Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp239422lqp; Thu, 4 Apr 2024 11:40:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVIYcXMenTsFeQSaiAzbnBBb4Ttm1gzNaRlWuvvD+cI3qzHC+VFL8FvmSN70iB2gprCqmQ8udkgvGnaMCXf0m0NIrxtOJWMgQvrbFLlYQ== X-Google-Smtp-Source: AGHT+IEsA5MkPAHyB9Z/vnyFYBtbmliWJjaPCa6HdgKjD9B7JOYoV0lP98o6N5U5t9+warw1Mn2c X-Received: by 2002:a17:903:41ca:b0:1e0:a8b8:aba3 with SMTP id u10-20020a17090341ca00b001e0a8b8aba3mr437335ple.35.1712256032358; Thu, 04 Apr 2024 11:40:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712256032; cv=pass; d=google.com; s=arc-20160816; b=Ne7/Tlu0h1zsMNgterXHybQewLU4hppP0YUTHcJ0ps8ffNxWZxDhRBDfcExjqBJvc3 faUPJzGOReb4P3ynGx6kkpLx9SbzbIlwGbDlMPiIuMfEtjjJBnPdZwFiDwvF3r6x6xDr 3lTmC9fcfdN7wftnPPsJDcXYE9dFyMZ3yq2IMJsISx2NLuKIBTjb0bRfiT51Xp0iV/rO 70HmrvVpAyiRK41B/2KJ+9tawHnnGIUoLDZqhLWSb735Q0ZOH6XbRWYIbzBs3wgyyn/I g0cpKBy+WtpmDPtl8zQusqQyZ8QS1mvXYVmgLVn3WopIZCBHg+jALYF+U9x7+rmppxIy Ak9Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date:dkim-signature; bh=9kzW8Pqu1bnnA+oNSBtPvHoXG/9BE85ObTGyLY0XoZ4=; fh=/qI4MxogksMJoitXvwTVG/d7E+Fmb4IDEU51bQiLe9k=; b=Xb8R0udKDnAH58IX0NW9gbB4ETOriJYn1nmMBya3ANRsmbAmuLXDrl+5GFLm6rogdr GuU1JOd37p3j/eNCSHkdCMXyW4zhVw6y6hfgG+VjieCx6e19D8Egz08apRSnqYVoBUf6 yJdu2FiA6e2EIeX9ZiVRC4cj7Xaz6ZaFtcB3DZ4A8qxTOoJ4RHN9lv82DQWMGsvRYyAY O0t2IJFIFCosE133TEqRay1HB+bDZPMij3HhDMVeKJ7BdKKU9biw5E4VrsKwoBCnS15K eopg3PZoCp9edGT5Eouo73kW1hQocQ7hcsOfguhOFkoVDg1FUPI2UtY+/2B2kBzXajsq kfCA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gLSSquWR; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-131889-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131889-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id i5-20020a170902cf0500b001e29acb2d55si3228660plg.113.2024.04.04.11.40.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 11:40:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-131889-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gLSSquWR; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-131889-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131889-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 89328B230CF for ; Thu, 4 Apr 2024 17:33:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A199B12DDBD; Thu, 4 Apr 2024 17:33:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="gLSSquWR" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4A4D812AAE8; Thu, 4 Apr 2024 17:33:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712251996; cv=none; b=phRHDMPYb5m0wWvH9H11/F/98+FvOHvSxgBK1HAZo8KFMhZEsOPenVcj4acPStpD0hFcfSeGpJocuiwtzz+lEutXknqGMHZ/o0VP+epZvNM0ZuZpoSkj0HKe+ipQcMhQToUNDALmWm+LAQ04+SKZmZzHgENSd+o8sOJvuj4HsVI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712251996; c=relaxed/simple; bh=WhycKvDs8Nm0e2yE6FewUWSMhX4pZiW2qepdqQnqjQU=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sAZUh9SJZkEoFU+9+mN3oU3m8YC8wE2SrAmPC6Nk98lRs6aZ6vie7UkAuINZnzEleTU+KgMCcs9miagB4vnFq4AxwwhT9vPG47HDEWsUwdtLhpKn2XgHDwj9Qrba3QSE9IFB9ciOOiY0OfHKOXEPrlmEgj13g48DKUfZ7cYvBeU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=gLSSquWR; arc=none smtp.client-ip=198.175.65.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712251995; x=1743787995; h=date:from:to:cc:subject:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WhycKvDs8Nm0e2yE6FewUWSMhX4pZiW2qepdqQnqjQU=; b=gLSSquWRbOk30KJOLa1Pxfr+fIXQGvKqAm1+bWUcE3J723rn7DVOLihZ upoXGlliFQ1XKgOuuKNn1JMjaM52YLSwRkIKwJBIgA3uKFlg0J1O1DWaY 6JziuEH437sZ0afJ+qBr+VVBjoA3G851z3ARjIaYbj71EoU6OHXC+bh7+ StT7knzN8Lxeqz7b58c3o2ageC6dtfw/44AFr3p5Ny+K+lvTvky6c/4SX bbuTPU4F16Vp99CNrk58ULrsmX1BCv0uzvjzoBs+KJcjM7d41uu2iwbtc 2bsp0Yjdpk8XrzNp/iUoqjgj9NOprBZlMBq5mcW2hxVAFnjHLaf2rQ3lE Q==; X-CSE-ConnectionGUID: 15L8qycaRnSAtoLa8Dqq2g== X-CSE-MsgGUID: bsmX5D5xQduy/bQKQwNrWw== X-IronPort-AV: E=McAfee;i="6600,9927,11034"; a="7709650" X-IronPort-AV: E=Sophos;i="6.07,179,1708416000"; d="scan'208";a="7709650" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2024 10:33:09 -0700 X-CSE-ConnectionGUID: TuJmPMI7T6u58LeAAqTTfg== X-CSE-MsgGUID: ximBQxIZSoGR85aXhPDCVQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,179,1708416000"; d="scan'208";a="23356605" Received: from jacob-builder.jf.intel.com (HELO jacob-builder) ([10.54.39.125]) by fmviesa003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2024 10:33:08 -0700 Date: Thu, 4 Apr 2024 10:37:35 -0700 From: Jacob Pan To: Robert Hoo Cc: LKML , X86 Kernel , Peter Zijlstra , iommu@lists.linux.dev, Thomas Gleixner , Lu Baolu , kvm@vger.kernel.org, Dave Hansen , Joerg Roedel , "H. Peter Anvin" , Borislav Petkov , Ingo Molnar , Paul Luse , Dan Williams , Jens Axboe , Raj Ashok , "Tian, Kevin" , maz@kernel.org, seanjc@google.com, Robin Murphy , jacob.jun.pan@linux.intel.com, Bjorn Helgaas Subject: Re: [PATCH 00/15] Coalesced Interrupt Delivery with posted MSI Message-ID: <20240404103735.003ed5a3@jacob-builder> In-Reply-To: References: <20240126234237.547278-1-jacob.jun.pan@linux.intel.com> Organization: OTC X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Robert, On Thu, 4 Apr 2024 21:45:05 +0800, Robert Hoo wrote: > On 1/27/2024 7:42 AM, Jacob Pan wrote: > > Hi Thomas and all, > >=20 > > This patch set is aimed to improve IRQ throughput on Intel Xeon by > > making use of posted interrupts. > >=20 > > There is a session at LPC2023 IOMMU/VFIO/PCI MC where I have presented > > this topic. > >=20 > > https://lpc.events/event/17/sessions/172/#20231115 > >=20 > > Background > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > On modern x86 server SoCs, interrupt remapping (IR) is required and > > turned on by default to support X2APIC. Two interrupt remapping modes > > can be supported by IOMMU/VT-d: > >=20 > > - Remappable (host) > > - Posted (guest only so far) > >=20 > > With remappable mode, the device MSI to CPU process is a HW flow > > without system software touch points, it roughly goes as follows: > >=20 > > 1. Devices issue interrupt requests with writes to 0xFEEx_xxxx > > 2. The system agent accepts and remaps/translates the IRQ > > 3. Upon receiving the translation response, the system agent > > notifies the destination CPU with the translated MSI > > 4. CPU's local APIC accepts interrupts into its IRR/ISR registers > > 5. Interrupt delivered through IDT (MSI vector) > >=20 > > The above process can be inefficient under high IRQ rates. The > > notifications in step #3 are often unnecessary when the destination CPU > > is already overwhelmed with handling bursts of IRQs. On some > > architectures, such as Intel Xeon, step #3 is also expensive and > > requires strong ordering w.r.t DMA. =20 >=20 > Can you tell more on this "step #3 requires strong ordering w.r.t. DMA"? >=20 I am not sure how much micro architecture details I can disclose but the point is that there are ordering rules related to DMA read/writes and posted MSI writes. I am not a hardware expert. =46rom PCIe pov, my understanding is that the upstream writes tested here on NVMe drives as the result of 4K random reads are relaxed ordered. I can see lspci showing: RlxdOrd+ on my Samsung drives. DevCtl: CorrErr+ NonFatalErr+ FatalErr+ UnsupReq- RlxdOrd+ ExtTag+ PhantFunc- AuxPwr- NoSnoop+ FLRese= t- MaxPayload 512 bytes, MaxReadReq 4096 bytes But MSIs are strictly ordered afaik. > > As a result, slower > > IRQ rates can become a limiting factor for DMA I/O performance. > > =20 >=20 >=20 Thanks, Jacob