linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Li, Aubrey" <aubrey.li@linux.intel.com>
To: David Laight <David.Laight@ACULAB.COM>,
	Thomas Gleixner <tglx@linutronix.de>,
	Aubrey Li <aubrey.li@intel.com>
Cc: "mingo@redhat.com" <mingo@redhat.com>,
	"peterz@infradead.org" <peterz@infradead.org>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"ak@linux.intel.com" <ak@linux.intel.com>,
	"tim.c.chen@linux.intel.com" <tim.c.chen@linux.intel.com>,
	"arjan@linux.intel.com" <arjan@linux.intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH v2 1/2] x86/fpu: detect AVX task
Date: Tue, 13 Nov 2018 21:06:47 +0800	[thread overview]
Message-ID: <2229f120-cb11-8f8e-f27d-eabc94457cd5@linux.intel.com> (raw)
In-Reply-To: <25dd33ee964f4de5ae33a1575e1bf47f@AcuMS.aculab.com>

On 2018/11/13 18:25, David Laight wrote:
> From: Li, Aubrey
>> Sent: 12 November 2018 01:41
> ...
>> VZEROUPPER instruction resets the init state. If context switch happens
>> to occur exactly after VZEROUPPER instruction, XINUSE bitmap is empty(all
>> zeros), which indicates the task is not using AVX. That's why the state
>> decay count is used here.
> 
> Isn't there an obvious optimisation to execute VZEROALL during system call
> entry?

I'm not aware of this in the kernel, maybe you are talking about some 
optimization in glibc?

> If that is done does any of this actually work?

The bitmap is checked during context switch, not system call entry.

Also, the flag is turned on immediately once it's detected, but requires 3
*consecutive* context switches with no usage to clear. So it could filter
most jitter patterns out.

I measured tensorflow(with AVX512), linpack(with AVX512) and a micro
benchmark, this works properly.

If you have a AVX512 workload, I'd like to know if this works for it.

Thanks,
-Aubrey
> 
> 	David
>  
> 
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
> Registration No: 1397386 (Wales)
> 


  reply	other threads:[~2018-11-13 13:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-07 17:16 [RFC PATCH v2 1/2] x86/fpu: detect AVX task Aubrey Li
2018-11-07 17:16 ` [RFC PATCH v2 2/2] proc: add /proc/<pid>/thread_state Aubrey Li
2018-11-09 11:21 ` [RFC PATCH v2 1/2] x86/fpu: detect AVX task Thomas Gleixner
2018-11-12  1:40   ` Li, Aubrey
2018-11-13 10:25     ` David Laight
2018-11-13 13:06       ` Li, Aubrey [this message]
2018-11-13 14:56         ` David Laight
2018-11-12  2:32 ` Dave Hansen
2018-11-12  5:38   ` Li, Aubrey
2018-11-12 15:46     ` Dave Hansen
2018-11-13  6:42       ` Li, Aubrey

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=2229f120-cb11-8f8e-f27d-eabc94457cd5@linux.intel.com \
    --to=aubrey.li@linux.intel.com \
    --cc=David.Laight@ACULAB.COM \
    --cc=ak@linux.intel.com \
    --cc=arjan@linux.intel.com \
    --cc=aubrey.li@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=tim.c.chen@linux.intel.com \
    /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).