[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [PATCH v3 23/23] IOMMU/x86: add perf counters for page table splitting / coalescing


  • To: "Beulich, Jan" <JBeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Tian, Kevin" <kevin.tian@xxxxxxxxx>
  • Date: Fri, 18 Feb 2022 05:23:20 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=EbWANJsRUZKLUt4JPLl6gZ4pr9WFC3q+JjvG5T4qSp4=; b=Z8q/0NvD1pfayOeYQ92if7xoc1QgzyAQs5TJb8CkET0u28bB1hsx4lV+beRUKIGWCVNGgbZs+3RIe4veGFgkF73mPhD6eIpR27IzzeOFczN75KVSxQkLccCcPYml2A2Uza8DrImWKcxMWguewbg3gOVZ65D25ePtpp3X2g128WVoDwD+prqC7nqe9Vy/YcGofQKBRE1xh0TIG07p2fBK58AKJP6UBxWjyWj19YIVULJFxDemWmXKnkXb/SZakw/NvDUsv8v1FvLxMUy8aJlT1Rho2WtLGs0C/0QKzS1NB+xvpZnG0TKiPz7UogSeo7RpLd4Nd37SBwhM5y+4t4PVOg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=klsHyxy/ZHkhJQJCFMkK5yQt/Ugsqyb9YngqFE/kSoZso+AHvas1TD9n1TrUGBnxWjRZ1w66m/sEv5s/xDW+bAZGEwonyni+xjaxtg+Ufuw/CHfikuRMTNnnfH0sXjQn9EVRgeKM2Tu/E88RF8O3tlsQ5KKdcYqUz9gvKg57bpUJ0y+DrmDIjqZ0C9tGfR5a2tSDtD33YiUrskfUoFDree+gX/1RiJ40TMqctZj75b7CwkxbI/pNCKBEBHuzNzQ2H6IENAYZXQ/+CP7oK6n2X/IhYQiSO8VTs6TYLFLzh5MrtK+1ZGXEajMcBui/o5CvTAe+2rmizTKfySE7byo6UA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com;
  • Cc: "Cooper, Andrew" <andrew.cooper3@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Pau Monné, Roger <roger.pau@xxxxxxxxxx>
  • Delivery-date: Fri, 18 Feb 2022 05:23:31 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHYBkCIiD6zzqjEpESy/R2RlVmrhayZAq9g
  • Thread-topic: [PATCH v3 23/23] IOMMU/x86: add perf counters for page table splitting / coalescing

> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: Tuesday, January 11, 2022 12:39 AM
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Reviewed-by: Kevin tian <kevin.tian@xxxxxxxxx>

> ---
> v3: New.
> 
> --- a/xen/drivers/passthrough/amd/iommu_map.c
> +++ b/xen/drivers/passthrough/amd/iommu_map.c
> @@ -283,6 +283,8 @@ static int iommu_pde_from_dfn(struct dom
>                                       level, PTE_kind_table);
> 
>              *flush_flags |= IOMMU_FLUSHF_modified;
> +
> +            perfc_incr(iommu_pt_shatters);
>          }
> 
>          /* Install lower level page table for non-present entries */
> @@ -411,6 +413,7 @@ int amd_iommu_map_page(struct domain *d,
>                                flags & IOMMUF_readable, &contig);
>          *flush_flags |= IOMMU_FLUSHF_modified | IOMMU_FLUSHF_all;
>          iommu_queue_free_pgtable(d, pg);
> +        perfc_incr(iommu_pt_coalesces);
>      }
> 
>      spin_unlock(&hd->arch.mapping_lock);
> @@ -471,6 +474,7 @@ int amd_iommu_unmap_page(struct domain *
>              clear_iommu_pte_present(pt_mfn, dfn_x(dfn), level, &free);
>              *flush_flags |= IOMMU_FLUSHF_all;
>              iommu_queue_free_pgtable(d, pg);
> +            perfc_incr(iommu_pt_coalesces);
>          }
>      }
> 
> --- a/xen/drivers/passthrough/vtd/iommu.c
> +++ b/xen/drivers/passthrough/vtd/iommu.c
> @@ -451,6 +451,8 @@ static uint64_t addr_to_dma_page_maddr(s
> 
>                  if ( flush_flags )
>                      *flush_flags |= IOMMU_FLUSHF_modified;
> +
> +                perfc_incr(iommu_pt_shatters);
>              }
> 
>              write_atomic(&pte->val, new_pte.val);
> @@ -907,6 +909,7 @@ static int dma_pte_clear_one(struct doma
> 
>          *flush_flags |= IOMMU_FLUSHF_all;
>          iommu_queue_free_pgtable(domain, pg);
> +        perfc_incr(iommu_pt_coalesces);
>      }
> 
>      spin_unlock(&hd->arch.mapping_lock);
> @@ -2099,6 +2102,7 @@ static int __must_check intel_iommu_map_
> 
>          *flush_flags |= IOMMU_FLUSHF_modified | IOMMU_FLUSHF_all;
>          iommu_queue_free_pgtable(d, pg);
> +        perfc_incr(iommu_pt_coalesces);
>      }
> 
>      spin_unlock(&hd->arch.mapping_lock);
> --- a/xen/arch/x86/include/asm/perfc_defn.h
> +++ b/xen/arch/x86/include/asm/perfc_defn.h
> @@ -125,4 +125,7 @@ PERFCOUNTER(realmode_exits,      "vmexit
> 
>  PERFCOUNTER(pauseloop_exits, "vmexits from Pause-Loop Detection")
> 
> +PERFCOUNTER(iommu_pt_shatters,    "IOMMU page table shatters")
> +PERFCOUNTER(iommu_pt_coalesces,   "IOMMU page table coalesces")
> +
>  /*#endif*/ /* __XEN_PERFC_DEFN_H__ */


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.