linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Noah Goldstein <goldstein.w.n@gmail.com>
To: Borislav Petkov <bp@alien8.de>
Cc: tglx@linutronix.de, mingo@redhat.com, X86 ML <x86@kernel.org>,
	hpa@zytor.com, Andy Lutomirski <luto@kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1] x86/fpu: Remove opmask state from avx512_timestamp check
Date: Thu, 14 Oct 2021 10:49:25 -0500	[thread overview]
Message-ID: <CAFUsyfLf5a6-L7f2AjLx3j8+qbG7EU9iLPJCTA0+UoOUg3C61A@mail.gmail.com> (raw)
In-Reply-To: <YWfqEIaCKOwSWGHF@zn.tnic>

On Thu, Oct 14, 2021 at 3:28 AM Borislav Petkov <bp@alien8.de> wrote:
>
> On Wed, Oct 13, 2021 at 05:36:14PM -0500, Noah Goldstein wrote:
> > Ping2
>
> Why?


This left me confused and annoyed for several hours because
the avx512 usage information on my applications didn't make
sense. Figured worth a patch for posterity.

>
> The original patch which added this abomination:
>
> 2f7726f95557 ("x86/fpu: Track AVX-512 usage of tasks")
>
> says already:
>
>  the tracking mechanism is imprecise and can theoretically miss AVX-512
>  usage during context switch. But it has been measured to be precise
>  enough to be useful under real-world workloads like tensorflow and
>  linpack.
>
>  If higher precision is required, suggest user space tools to use the
>  PMU-based mechanisms in combination.

This patch isn't about higher precision / false negatives.
It's about false positives.

>
> and as you've noticed, the high 16 regs would cause a false positive
> too.
>
> So what is the actual real-life use case for this?

No big project. There is a case for avoiding the extended avx512
registers (reg16..31) for various reasons (context switches,
code size, instruction limitations) that don't apply to mask registers.

Irrelevant of the still existing flaws, it makes the output more accurate.

Is there a cost to the change I am not seeing?

If not it seems to be a tradeoff between more accurate vs less accurate.
So why not take the former?

>
> --
> Regards/Gruss,
>     Boris.
>
> https://people.kernel.org/tglx/notes-about-netiquette

  reply	other threads:[~2021-10-14 15:49 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 [this message]
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   ` [PATCH v5 2/2] x86/xstate: Make AVX512 status tracking more accurate Noah Goldstein
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=CAFUsyfLf5a6-L7f2AjLx3j8+qbG7EU9iLPJCTA0+UoOUg3C61A@mail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).