mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Yang, Weijiang" <weijiang.yang@intel.com>
To: <tglx@linutronix.de>, <dave.hansen@intel.com>, <x86@kernel.org>,
	<seanjc@google.com>, <pbonzini@redhat.com>,
	<linux-kernel@vger.kernel.org>, <kvm@vger.kernel.org>
Cc: <peterz@infradead.org>, <chao.gao@intel.com>,
	<rick.p.edgecombe@intel.com>, <mlevitsk@redhat.com>,
	<john.allen@amd.com>
Subject: Re: [PATCH 0/6] Introduce CET supervisor state support
Date: Tue, 9 Jul 2024 11:17:57 +0800	[thread overview]
Message-ID: <67c5a358-0e40-4b2f-b679-33dd0dfe73fb@intel.com> (raw)
In-Reply-To: <20240531090331.13713-1-weijiang.yang@intel.com>

Hi, maintainers,
I recently did some tests for this series, the benchmark is here:
https://github.com/antonblanchard/will-it-scale/blob/master/tests/context_switch1.c

The purpose is to check what's the overall performance impact in thread/process context-
switch when CET supervisor state bit, i.e., RFBM[12], is fixed with 0 or 1 in xsaves/xrstors.

3 cases are tested:
case 1: stock v6.10-rc1 kernel.
case 2: v6.10-rc1 kernel + this patch series so that RFBM[12] == 0 for normal thread/process.
case 3: v6.10-rc1 kernel + this patch series and with patch 3(Introduce XFEATURE_MASK_KERNEL_DYNAMIC
xfeature set) reverted so that RFBM[12] == 1 for normal thread process.

Run below command 10 times in each case:

./context_switch1_processes -s 20 -t 50 -n

Trim the results by removing the top and down 10% of the data in each case, and I got below numbers:

case 1:16444675.45Set as 1

case 2:16412285.61~99.80%

case 3:16405716.19~99.76%

As you can see from the results, in case 2 with optimization based on XFEATURE_MASK_KERNEL_DYNAMIC,
the performance gain is ~0.2%.

So I'm not sure whether XFEATURE_MASK_KERNEL_DYNAMIC and related changes are worth or not
for this series.

Could you share your thoughts?

Thanks a lot!








  parent reply	other threads:[~2024-07-09  3:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-31  9:03 Yang Weijiang
2024-05-31  9:03 ` [PATCH 1/6] x86/fpu/xstate: Always preserve non-user xfeatures/flags in __state_perm Yang Weijiang
2024-05-31  9:03 ` [PATCH 2/6] x86/fpu/xstate: Add CET supervisor mode state support Yang Weijiang
2024-05-31  9:03 ` [PATCH 3/6] x86/fpu/xstate: Introduce XFEATURE_MASK_KERNEL_DYNAMIC xfeature set Yang Weijiang
2024-05-31  9:03 ` [PATCH 4/6] x86/fpu/xstate: Introduce fpu_guest_cfg for guest FPU configuration Yang Weijiang
2024-05-31  9:03 ` [PATCH 5/6] x86/fpu/xstate: Create guest fpstate with guest specific config Yang Weijiang
2024-05-31  9:03 ` [PATCH 6/6] x86/fpu/xstate: Warn if CET supervisor state is detected in normal fpstate Yang Weijiang
2024-07-09  3:17 ` Yang, Weijiang [this message]
2024-07-11 20:58   ` [PATCH 0/6] Introduce CET supervisor state support Dave Hansen
2024-07-11 22:11     ` Edgecombe, Rick P
2024-07-11 22:30       ` Dave Hansen
2024-07-11 22:55         ` Edgecombe, Rick P
2024-07-12 14:36           ` Dave Hansen
2024-07-12  6:27     ` Yang, Weijiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=67c5a358-0e40-4b2f-b679-33dd0dfe73fb@intel.com \
    --to=weijiang.yang@intel.com \
    --cc=chao.gao@intel.com \
    --cc=dave.hansen@intel.com \
    --cc=john.allen@amd.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mlevitsk@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rick.p.edgecombe@intel.com \
    --cc=seanjc@google.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®