Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2381407rdb; Thu, 21 Sep 2023 17:55:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHpXx58wDOQWYI7MoDm0MvoZ5ViESGlm0hXi29kGchozpZuRstFXSnAlQQ0veriX8UVcTRB X-Received: by 2002:a05:6359:6299:b0:143:8bc6:ac4 with SMTP id se25-20020a056359629900b001438bc60ac4mr1658034rwb.14.1695344110158; Thu, 21 Sep 2023 17:55:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695344110; cv=none; d=google.com; s=arc-20160816; b=snU5zhJDb15ZW6UMxjEILwE/yM85NBO9Gv3kSwRYXiSp7xA0oYkfnL9Br4bYl3ilzj RvvTTNiczv29+U3Pwa62p927fEJSPG2bZrM96PhNEVE6xP6jghfjdm+gry3erv9S/4yr 5KNEXyxIWHgjRff5x8gEIGHw78fyM+3hIx20MUcCTsJaT6HjEp4HoXUogWLLwUu7YPly N2ogVwLjA04masyiCosEQHu5Vam334bYRAYq4PRj7LOlOZHgbcFAFGoMVdEtNp3jjuvB 3AVHT9/D4T0xCUiWehYQY0ptF91WJwaXTHGBE2T2mJQy0aH+2FxnrjN9Q0cgeoARVzIo I93g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=qkkKp5QGuMZx2u3heISQHtLw66nMgJ/aOOLheyS9SsA=; fh=PkCD+R2AQNFxw8NX69qrS8AoRdogfcv9any3b9NGOvk=; b=Vft/jqOTb7ddO1upQv59CWyB0WeBiPVqL01VVvwD+8x8Vt87nwAUrEgiYY5H5SozqK nhzrc7AhICw3NkT/GOFPamzlrNzYlnp52FsiWZsxvmYCdZkzsHMoLHB5RyVhae74AnXC +gAQM55TE3+eHKmL4PJTxa2OfsXHPW67Ji99hlpB2xD2DmzMcydKvDM6iMz3Tbt1y2f2 t8F5aJVOaJmW4OGpWU1Dr1cxavi2b5yB8PlP6SldYbbuCl6sV32WHYVepy5jVPBSjEVZ XGi45vDajJpWHeC9uN+iRNm/0RrdXQbKKZ166lBCMbvn+giBlyOccq/2PIJ2Zr7d1qD3 9nBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GPNDU+yD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id o8-20020a056a001bc800b00690d02ac9acsi2554575pfw.77.2023.09.21.17.55.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 17:55:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GPNDU+yD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 2E10982CAC02; Thu, 21 Sep 2023 12:53:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230163AbjIUTxp (ORCPT + 99 others); Thu, 21 Sep 2023 15:53:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230261AbjIUTxc (ORCPT ); Thu, 21 Sep 2023 15:53:32 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 104E290F02 for ; Thu, 21 Sep 2023 10:47:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695318438; x=1726854438; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=t2mbJ75fInyWH5iiLT8RC4XEZIKGqU0/wfgMAXYwMVw=; b=GPNDU+yDyxyCruBmXr3xug8yEt4aYS5URIAZ+vvRAV/CtVa2majbFmvv oaQycsKpveTcBXywsxeVBGafjzdxqicn0eI3oh5jb0jo6IPymprFX7iMz T59AroS3QW+F2RSsVcqiAN9IgPi2sQMBAtci+rxFa271zVlxCqY3vgnLU RSAPzUbkQfsdJN0ZNhKWE799FMwk2+Ze/O9qho7tNAKdGRNbCXW/Y3PSI lVFFT7NVV0yi8t3Kin1B2huDpO0Q/yIoloux1OKSJlWUqT4eQxpnni5yH 9dvAdUNnjPaySpVjK1qj9MwH9mpUT+sR0VsC0pBJsMBoKxD2/nSsHzQyA w==; X-IronPort-AV: E=McAfee;i="6600,9927,10839"; a="377729731" X-IronPort-AV: E=Sophos;i="6.03,164,1694761200"; d="scan'208";a="377729731" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Sep 2023 23:29:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10839"; a="920606306" X-IronPort-AV: E=Sophos;i="6.03,164,1694761200"; d="scan'208";a="920606306" Received: from sunyi-station.sh.intel.com (HELO ysun46-mobl.sh.intel.com) ([10.239.159.10]) by orsmga005.jf.intel.com with ESMTP; 20 Sep 2023 23:29:50 -0700 From: Yi Sun To: dave.hansen@intel.com, mingo@kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org Cc: sohil.mehta@intel.com, ak@linux.intel.com, ilpo.jarvinen@linux.intel.com, heng.su@intel.com, tony.luck@intel.com, yi.sun@linux.intel.com, yu.c.chen@intel.com, Yi Sun Subject: [PATCH v7 0/3] x86/fpu Measure the Latency of XSAVES and XRSTORS Date: Thu, 21 Sep 2023 14:28:57 +0800 Message-Id: <20230921062900.864679-1-yi.sun@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=ham 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 21 Sep 2023 12:53:49 -0700 (PDT) This series implements a solution for measuring the latency of XSAVES/XRSTORS instructions on x86 processors. The motivation for This solution is to provide a way to identify potential bottlenecks and anomalies in the implementation of these instructions on different X86 hardware platforms and identify when the cost of XSAVES/XRSTORS is increasing or decreasing. And Get the RFBM and XINUSE to figure out reason if there are any issues. The solution enables the comparison of the latency of the FPU across different systems from various vendors over an long period of time. The solution consists of two parts: 1. Two new tracepoints that calculate delta TSC as the latency. 2. A user-space tool that consumes trace logs and shows results. We conducted extensive internal testing and compared several latency computation methodologies. We believe it could be improved. Also the script for consuming trace logs uses sqlite3 to display statistics data such as max and min latency, and 97% tail latency, etc. - Change from v6 to v7: - Rebase patch to the most recent tag v6.6-rc1, no conflict. - Remove all the additional crusts when disable CONFIG_X86_DEBUG_FPU. (Ingo Molnar) - Change from v5 to v6: - Rebase patch to the most recent tag v6.5-rc7, no conflict. - Add a colomn 'count' to the output of the script. - Change from v4 to v5: - Rebase patch to the most recent tag v6.1-rc2, no conflict. - Change from v3 to v4: - Rebase patch set to the latest tag v6.0-rc3, replacing ALTERNATIVE_2 with ALTERNATIVE_3 - Change from v2 to v3: - Move the script xsave-latency-trace.sh to folder tools/testing/fpu/ (Ingo Molnar) - Change from v1 to v2: - Reword the comments. (Laight, David; Mehta, Sohil) - Rename all variable 'dtsc' to 'latency'. (Mehta, Sohil) *** BLURB HERE *** Yi Sun (3): x86/fpu: Measure the Latency of XSAVE and XRSTOR tools/testing/fpu: Add script to consume trace log of xsave latency tools/testing/fpu: Add a 'count' column. arch/x86/include/asm/trace/fpu.h | 37 ++++ arch/x86/kernel/fpu/xstate.h | 42 +++- tools/testing/fpu/xsave-latency-trace.sh | 234 +++++++++++++++++++++++ 3 files changed, 308 insertions(+), 5 deletions(-) create mode 100755 tools/testing/fpu/xsave-latency-trace.sh -- 2.34.1 From d9f24eb83ef259ccea780caee02abdd2db5911b5 Mon Sep 17 00:00:00 2001 From: Yi Sun Date: Fri, 1 Sep 2023 20:05:01 +0800 Yi Sun (3): x86/fpu: Measure the Latency of XSAVE and XRSTOR tools/testing/fpu: Add script to consume trace log of xsave latency tools/testing/fpu: Add a 'count' column. arch/x86/include/asm/trace/fpu.h | 35 ++++ arch/x86/kernel/fpu/xstate.h | 49 ++++- tools/testing/fpu/xsave-latency-trace.sh | 234 +++++++++++++++++++++++ 3 files changed, 313 insertions(+), 5 deletions(-) create mode 100755 tools/testing/fpu/xsave-latency-trace.sh -- 2.34.1