All of lore.kernel.org
 help / color / mirror / Atom feed
From: Noah Goldstein <goldstein.w.n@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: goldstein.w.n@gmail.com, tglx@linutronix.de, mingo@redhat.com,
	bp@alien8.de, x86@kernel.org, hpa@zytor.com, luto@kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v5 2/2] x86/xstate: Make AVX512 status tracking more accurate
Date: Wed, 27 Oct 2021 13:21:03 -0500	[thread overview]
Message-ID: <20211027182103.2569136-2-goldstein.w.n@gmail.com> (raw)
In-Reply-To: <20211027182103.2569136-1-goldstein.w.n@gmail.com>

Update the mask for tracking AVX512 usage to not include the opmask
xfeature set.

The purpose of tracking the AVX512 status is to convey information
about possible frequency throttling. Opmask usage does not cause
frequency throttling so it is a completely unnecessary false positive.

Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
---
 arch/x86/include/asm/fpu/types.h | 4 ++++
 arch/x86/kernel/fpu/xstate.c     | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/fpu/types.h b/arch/x86/include/asm/fpu/types.h
index f5a38a5f3ae1..e9a48f75159e 100644
--- a/arch/x86/include/asm/fpu/types.h
+++ b/arch/x86/include/asm/fpu/types.h
@@ -142,6 +142,10 @@ enum xfeature {
 					 | XFEATURE_MASK_ZMM_Hi256 \
 					 | XFEATURE_MASK_Hi16_ZMM)
 
+#define XFEATURE_MASK_AVX512_THROTTLE		(XFEATURE_MASK_ZMM_Hi256 \
+					 | XFEATURE_MASK_Hi16_ZMM)
+
+
 #define FIRST_EXTENDED_XFEATURE	XFEATURE_YMM
 
 struct reg_128_bit {
diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c
index 00b495914be2..e129fae48792 100644
--- a/arch/x86/kernel/fpu/xstate.c
+++ b/arch/x86/kernel/fpu/xstate.c
@@ -1254,7 +1254,7 @@ void fpu_update_avx_timestamp(struct fpu *fpu)
 	 * AVX512 state is tracked here because its use is known to slow
 	 * the max clock speed of the core.
 	 */
-	if (fpu->state.xsave.header.xfeatures & XFEATURE_MASK_AVX512)
+	if (fpu->state.xsave.header.xfeatures & XFEATURE_MASK_AVX512_THROTTLE)
 		fpu->avx512_timestamp = jiffies;
 }
 
-- 
2.25.1


  reply	other threads:[~2021-10-27 18:21 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-20  5:39 [PATCH v1] x86/fpu: Remove opmask state from avx512_timestamp check Noah Goldstein
2021-09-27 18:02 ` Noah Goldstein
2021-10-13 22:36   ` Noah Goldstein
2021-10-14  8:28     ` Borislav Petkov
2021-10-14 15:49       ` Noah Goldstein
2021-10-15 14:40         ` Borislav Petkov
2021-10-15 15:25         ` Dave Hansen
2021-10-15 17:30           ` Noah Goldstein
2021-10-15 20:47 ` [PATCH v2 1/2] x86/fpu: Add helper function for tracking AVX512 status Noah Goldstein
2021-10-26 23:15   ` Noah Goldstein
2021-10-15 20:47 ` [PATCH v2 2/2] x86/xstate: Make AVX512 status tracking more accurate Noah Goldstein
2021-10-27 11:07   ` Borislav Petkov
2021-10-27 16:28     ` Noah Goldstein
2021-10-27 16:58       ` Borislav Petkov
2021-10-27 17:18         ` Noah Goldstein
2021-10-27 16:26 ` [PATCH v3 1/2] x86/fpu: Add helper function for tracking AVX512 status Noah Goldstein
2021-10-27 16:26   ` [PATCH v3 2/2] x86/xstate: Make AVX512 status tracking more accurate Noah Goldstein
2021-10-27 17:11     ` Borislav Petkov
2021-10-27 17:37       ` Noah Goldstein
2021-10-27 17:45         ` Borislav Petkov
2021-10-27 18:21           ` Noah Goldstein
2021-11-03 20:22             ` Noah Goldstein
2021-11-03 20:48               ` Borislav Petkov
2021-11-03 20:56                 ` Noah Goldstein
2021-10-27 17:17 ` [PATCH v4 1/2] x86/fpu: Add helper function for tracking AVX512 status Noah Goldstein
2021-10-27 17:17   ` [PATCH v4 2/2] x86/xstate: Make AVX512 status tracking more accurate Noah Goldstein
2021-10-27 18:21 ` [PATCH v5 1/2] x86/fpu: Add helper function for tracking AVX512 status Noah Goldstein
2021-10-27 18:21   ` Noah Goldstein [this message]
2021-11-16 16:21     ` [PATCH] x86/fpu: Correct AVX512 state tracking Borislav Petkov
2021-11-16 16:49       ` Noah Goldstein
2021-11-17 18:29 ` [tip: x86/fpu] " tip-bot2 for Noah Goldstein

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=20211027182103.2569136-2-goldstein.w.n@gmail.com \
    --to=goldstein.w.n@gmail.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.