Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp632200lqo; Thu, 16 May 2024 17:37:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWTO+ebA5qc0aPq+u8ZQto2UKihcm1z5kqmtRGpVvqop0ZpDcAmhQfKyEEqQfULOm/XOyuavgFt/7L2u6B3MquPI1R4qzYqO9lOKHnIbw== X-Google-Smtp-Source: AGHT+IG15QpKyLCxgXAaoHgQniDjldEDqagtjk8NmrXO9f8MMi3mAeLuje0B7SL75goaEAbs76me X-Received: by 2002:a05:6a00:1409:b0:6e7:4abe:85a0 with SMTP id d2e1a72fcca58-6f4e02c65b0mr25142345b3a.14.1715906277154; Thu, 16 May 2024 17:37:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715906277; cv=pass; d=google.com; s=arc-20160816; b=ngMlZbjbyIs60xssjKHRWVIQyyUoEb+5JeqbwZGTvmiDNrHvh3wvMejmMno07m0QxO pawHRacV56AZDLAIt+Wnde3mgommpqG+Fb6BgVick9DtUDfM99h8EoNhIW17GLhVgizw 6w01oIGs0/BjWnikUzq5Qv1F8GejrLJS7xY4nSXkZ6bRLPvjn9K5CIm5sY+FRDg6sPRT BdHxQxXhtASvSOGmHoMwBBt+ylaFWI7ygqyl0rzsodZM+U4tYGmuS5rWJHzoaDU7tTEi 1gm/f7AkzwjAQiqV/YL08Zlt/NYs1Ut0YjdfKSfVh2dYs9O9iEfTXXUMAxgJHqVGI2fk 4mHw== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=9mw9O3UJmAJfXesVFsg/SzBfrqnAlAMhG2mdFDz11AI=; fh=cdybUPbikZ5lvSU8wC8de40a7enJ2td/0dyhfzvODoI=; b=ulTM+JlikbxSm2G6Q/d5abAtfdv+jWKyhTkvpfbxuv8oOay36WY3nr8byvR/0Szbnh dO4y3Y8zTqE2pqpLBULU6i8qBQpBM0Wgrox0ERwue/R4ckDVIKtiSEF/kdIrQaO+oglN MglbCSIR/n8AaU5YZggOa3M0t21PRheuhqUKjkFFKxYCUpfeWQU3dYgrHqORQNepkaus XmCqfdFQGlJs7bC37Z4MaWGbhr6UOIu5SwPzAwDaCq9IH4nCrB6jjJYyPgvwQBH0Td2u PuqfB09tNokJ/sweovDPvY8tz8v6sp+lUXLct11IlsrFvOQ3m/t3tk1CsB/QFdEQwnev fEDg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=QS91vYRn; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-181654-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181654-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 d2e1a72fcca58-6f4d2aee1f4si17257911b3a.158.2024.05.16.17.37.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 17:37:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-181654-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=QS91vYRn; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-181654-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181654-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 7980BB21B93 for ; Fri, 17 May 2024 00:37:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8703E818; Fri, 17 May 2024 00:37:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="QS91vYRn" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (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 13DCE38B for ; Fri, 17 May 2024 00:37:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.20 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715906262; cv=none; b=KlyFLqsfhwP6pNXqRDAQg6+mphL3OU0zUkgcbhTtd0HKzuGcEQXWDhe53fncUMXiqRyrobOJyjB5wtnvVkPnDliSDxtucFEP4vN+dF8qqqpYLz8/S9M6y8Bu9PTvT0+DPKLMfAGhmccn0V4oBIY/auhJCJOsUju4+mMO+0ZnrMc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715906262; c=relaxed/simple; bh=tndkoDzPtQvDNXxDV1mSnTTkMJDHaP78U5UqidIWjYs=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=himo5ZM7JFdNjobZ/xo4iYSwaUJwEaXDwkxm6v5bqCJrrbD63zgRysni964mILtPJdllb02oNp5o1QuoSr6wQ/Z1sG93nMLZTA2cHKmJ7LZY51Az1IbFx9ZsFPy5nl9EH35xLM9owzRrcNEZ9VirB4IkzJD92DsOBeP6fpUrRQM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=QS91vYRn; arc=none smtp.client-ip=198.175.65.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715906261; x=1747442261; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=tndkoDzPtQvDNXxDV1mSnTTkMJDHaP78U5UqidIWjYs=; b=QS91vYRnxZQhOmnOqFPJKneVnDhPJGjkogTaM0g6MTSIBZ+5oRejEoY3 TfDH8O9pxCWjDu7imoMAYoXX3W0beESCgl9gXKQJ0OW32njSD/Z8rhl4V X+r4oIOVc3k2639JimT93gLIuiNZ/rTKd8NRRO5+1UcOVV/etpLR4rb0S O7m4FmcWoTZXXhvF4kwm6XwXkg6L/5MUEqQOViYE47sgBcNR1Moq9cXBk xqK9NRkQvfvHzQNmJF1+S6MPSa9FeIaC5Ho9yvQvvxNlcsqNMSDr/fxuM ThRGwKgjOeyXFT32vgYMTniaddW1F6it5OqMSfVKgt2h7JfK0yL9y3U4h Q==; X-CSE-ConnectionGUID: LE/cI9V2QSaDN03D4Pg2Vw== X-CSE-MsgGUID: ZVLuynsQSHuV+s1GTyZG9g== X-IronPort-AV: E=McAfee;i="6600,9927,11074"; a="11902648" X-IronPort-AV: E=Sophos;i="6.08,166,1712646000"; d="scan'208";a="11902648" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2024 17:37:41 -0700 X-CSE-ConnectionGUID: BtiX2U+3TIWcd6a+mHE9NQ== X-CSE-MsgGUID: vKWrfaihT5qA63g8qnzQnA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,166,1712646000"; d="scan'208";a="32217181" Received: from chunleis-mobl.ccr.corp.intel.com (HELO tinazhan-desk1.www.tendawifi.com) ([10.254.214.190]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2024 17:37:39 -0700 From: Tina Zhang To: Lu Baolu , Kevin Tian Cc: iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Tina Zhang Subject: [PATCH 0/2] Batch IOTLB/dev-IOTLB invalidation Date: Fri, 17 May 2024 08:37:26 +0800 Message-Id: <20240517003728.251115-1-tina.zhang@intel.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit IOTLB and dev-IOTLB invalidation operations are performance-critical. The current implementation in the VT-d driver submits these commands individually, leading to some inefficiencies due to the IOMMU programming and invalidation command processing overhead for each operation. This patch series, based on "Consolidate domain cache invalidation" series[1], enhances the efficiency of Queue Invalidation (QI) operations by adding support for batch processing. Microbenchmarks show that with a DSA device working in SVA, batching IOTLB and dev-IOTLB invalidations can decrease the time spent in qi_submit_sync() by roughly more than 800 cycles. Tina Zhang (2): iommu/vt-d: Support batching IOTLB/dev-IOTLB invalidation commands iommu/vt-d: Batch IOTLB/dev-IOTLB invalidation commands [1]: https://lore.kernel.org/linux-iommu/20240416080656.60968-1-baolu.lu@linux.intel.com/ drivers/iommu/intel/cache.c | 89 ++++++++++++++++++++++++++++++------- drivers/iommu/intel/dmar.c | 67 +++++++++++++++------------- drivers/iommu/intel/iommu.c | 27 ++++++----- drivers/iommu/intel/iommu.h | 21 ++++++--- drivers/iommu/intel/pasid.c | 20 +++++---- 5 files changed, 152 insertions(+), 72 deletions(-) -- 2.39.3