From patchwork Tue Sep 5 09:32:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yi Sun X-Patchwork-Id: 9938339 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8AAE8603F9 for ; Tue, 5 Sep 2017 09:53:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7AEF128902 for ; Tue, 5 Sep 2017 09:53:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6FC1F2890E; Tue, 5 Sep 2017 09:53:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C53E228908 for ; Tue, 5 Sep 2017 09:53:46 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dpAWf-0007j8-Co; Tue, 05 Sep 2017 09:52:09 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dpAWe-0007gm-3v for xen-devel@lists.xenproject.org; Tue, 05 Sep 2017 09:52:08 +0000 Received: from [193.109.254.147] by server-1.bemta-6.messagelabs.com id 46/3E-03414-7C37EA95; Tue, 05 Sep 2017 09:52:07 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrFLMWRWlGSWpSXmKPExsXS1tYhoXu0eF2 kwYnNphbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bex/NZCvaoVXzaMpexgbFPoYuRi0NIYDqj xKf7vWxdjJwcEgK8EkeWzWDtYuQAsv0ljl9TgahpYJR4Pm05O0gNm4C6xOOvPUwgtoiAksS9V ZOZQIqYBc4xSez5uAMsISxgLfFi4jowm0VAVWLPho9gzbwCHhJHP/9ihFgmJ3Hy2GSwZZxA8a XX6kDCQgLuEn+23WWdwMi7gJFhFaNGcWpRWWqRrrGhXlJRZnpGSW5iZo6uoYGZXm5qcXFiemp OYlKxXnJ+7iZGYDgwAMEOxqZFgYcYJTmYlER5QxPXRQrxJeWnVGYkFmfEF5XmpBYfYpTh4FCS 4K0rAsoJFqWmp1akZeYAAxMmLcHBoyTCOwUkzVtckJhbnJkOkTrFqMuxYfX6L0xCLHn5ealS4 rzHQYoEQIoySvPgRsCi5BKjrJQwLyPQUUI8BalFuZklqPKvGMU5GJWEeZeATOHJzCuB2/QK6A gmoCOqXq4BOaIkESEl1cCYV9RyLZVPW3HPzi9hL2a1CJXqPnqxduqHRytfGpfxP+6epr3jslL +no2pH+/MXXjN4vXVBo5fZp/KQq4/Yitz1Rd/+NozJ6532aR/yXG3T/sdy2/aO+do3EkWz0kV X1/pbL/tacv+3FhWI+L1atVHU56/Nfxn/eRw7KT5zyYVrl9SvaB7q8fiKUosxRmJhlrMRcWJA J988gmNAgAA X-Env-Sender: yi.y.sun@linux.intel.com X-Msg-Ref: server-10.tower-27.messagelabs.com!1504605120!91943336!2 X-Originating-IP: [134.134.136.24] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjQgPT4gMzkwOTcx\n X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 40763 invoked from network); 5 Sep 2017 09:52:05 -0000 Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24) by server-10.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 5 Sep 2017 09:52:05 -0000 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Sep 2017 02:52:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,479,1498546800"; d="scan'208";a="897185538" Received: from vmmmba-s2600wft.bj.intel.com ([10.240.193.80]) by FMSMGA003.fm.intel.com with ESMTP; 05 Sep 2017 02:52:00 -0700 From: Yi Sun To: xen-devel@lists.xenproject.org Date: Tue, 5 Sep 2017 17:32:37 +0800 Message-Id: <1504603957-5389-16-git-send-email-yi.y.sun@linux.intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1504603957-5389-1-git-send-email-yi.y.sun@linux.intel.com> References: <1504603957-5389-1-git-send-email-yi.y.sun@linux.intel.com> Cc: kevin.tian@intel.com, wei.liu2@citrix.com, andrew.cooper3@citrix.com, dario.faggioli@citrix.com, ian.jackson@eu.citrix.com, Yi Sun , julien.grall@arm.com, mengxu@cis.upenn.edu, jbeulich@suse.com, chao.p.peng@linux.intel.com, dgdegra@tycho.nsa.gov, roger.pau@citrix.com Subject: [Xen-devel] [PATCH v3 15/15] docs: add MBA description in docs X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patch adds MBA description in related documents. Signed-off-by: Yi Sun Acked-by: Wei Liu --- v2: - state the value type shown by 'psr-mba-show'. For linear mode, it shows decimal value. For non-linear mode, it shows hexadecimal value. (suggested by Chao Peng) --- docs/man/xl.pod.1.in | 34 +++++++++++++++++++++++++ docs/misc/xl-psr.markdown | 63 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+) diff --git a/docs/man/xl.pod.1.in b/docs/man/xl.pod.1.in index 16c8306..e644b19 100644 --- a/docs/man/xl.pod.1.in +++ b/docs/man/xl.pod.1.in @@ -1798,6 +1798,40 @@ processed. =back +=head2 Memory Bandwidth Allocation + +Intel Skylake and later server platforms offer capabilities to configure and +make use of the Memory Bandwidth Allocation (MBA) mechanisms, which provides +OS/VMMs the ability to slow misbehaving apps/VMs or create advanced closed-loop +control system via exposing control over a credit-based throttling mechanism. +In the Xen implementation, MBA is used to control memory bandwidth on VM basis. +To enforce bandwidth on a specific domain, just set throttling value (THRTL) +for the domain. + +=over 4 + +=item B [I] I I + +Set throttling value (THRTL) for a domain. For how to specify I +please refer to L. + +B + +=over 4 + +=item B<-s SOCKET>, B<--socket=SOCKET> + +Specify the socket to process, otherwise all sockets are processed. + +=back + +=item B [I] + +Show MBA settings for a certain domain or all domains. For linear mode, it +shows the decimal value. For non-linear mode, it shows hexadecimal value. + +=back + =head1 IGNORED FOR COMPATIBILITY WITH XM xl is mostly command-line compatible with the old xm utility used with diff --git a/docs/misc/xl-psr.markdown b/docs/misc/xl-psr.markdown index 04dd957..39fc801 100644 --- a/docs/misc/xl-psr.markdown +++ b/docs/misc/xl-psr.markdown @@ -186,6 +186,69 @@ Setting data CBM for a domain: Setting the same code and data CBM for a domain: `xl psr-cat-set ` +## Memory Bandwidth Allocation (MBA) + +Memory Bandwidth Allocation (MBA) is a new feature available on Intel +Skylake and later server platforms that allows an OS or Hypervisor/VMM to +slow misbehaving apps/VMs or create advanced closed-loop control system via +exposing control over a credit-based throttling mechanism. To enforce bandwidth +on a specific domain, just set throttling value (THRTL) into Class of Service +(COS). MBA provides two THRTL mode. One is linear mode and the other is +non-linear mode. + +In the linear mode the input precision is defined as 100-(THRTL_MAX). Values +not an even multiple of the precision (e.g., 12%) will be rounded down (e.g., +to 10% delay applied). + +If linear values are not supported then input delay values are powers-of-two +from zero to the THRTL_MAX value from CPUID. In this case any values not a power +of two will be rounded down the next nearest power of two. + +For example, assuming a system with 2 domains: + + * A THRTL of 0x0 for every domain means each domain can access the whole cache + without any delay. This is the default. + + * Linear mode: Giving one domain a THRTL of 0xC and the other domain's 0 means + that the first domain gets 10% delay to access the cache and the other one + without any delay. + + * Non-linear mode: Giving one domain a THRTL of 0xC and the other domain's 0 + means that the first domain gets 8% delay to access the cache and the other + one without any delay. + +For more detailed information please refer to Intel SDM chapter +"Introduction to Memory Bandwidth Allocation". + +In Xen's implementation, THRTL can be configured with libxl/xl interfaces but +COS is maintained in hypervisor only. The cache partition granularity is per +domain, each domain has COS=0 assigned by default, the corresponding THRTL is +0, which means all the cache resource can be accessed without delay. + +### xl interfaces + +System MBA information such as maximum COS and maximum THRTL can be obtained by: + +`xl psr-hwinfo --mba` + +The simplest way to change a domain's THRTL from its default is running: + +`xl psr-mba-set [OPTIONS] ` + +In a multi-socket system, the same thrtl will be set on each socket by default. +Per socket thrtl can be specified with the `--socket SOCKET` option. + +Setting the THRTL may not be successful if insufficient COS is available. In +such case unused COS(es) may be freed by setting THRTL of all related domains to +its default value(0). + +Per domain THRTL settings can be shown by: + +`xl psr-mba-show [OPTIONS] ` + +For linear mode, it shows the decimal value. For non-linear mode, it shows +hexadecimal value. + ## Reference [1] Intel SDM