From: Dave Martin <Dave.Martin@arm.com>
To: "Li, Aubrey" <aubrey.li@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Michael Ellerman <mpe@ellerman.id.au>,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will.deacon@arm.com>,
Aubrey Li <aubrey.li@intel.com>,
tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
ak@linux.intel.com, tim.c.chen@linux.intel.com,
dave.hansen@intel.com, arjan@linux.intel.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/2] proc: add /proc/<pid>/arch_state
Date: Fri, 23 Nov 2018 17:11:04 +0000 [thread overview]
Message-ID: <20181123171102.GI3505@e103592.cambridge.arm.com> (raw)
In-Reply-To: <7098dd35-3d7b-57c9-c450-10eee577c199@linux.intel.com>
On Thu, Nov 22, 2018 at 09:40:24AM +0800, Li, Aubrey wrote:
> On 2018/11/21 17:53, Peter Zijlstra wrote:
> > On Wed, Nov 21, 2018 at 09:19:36AM +0100, Peter Zijlstra wrote:
> >> On Wed, Nov 21, 2018 at 09:39:00AM +0800, Li, Aubrey wrote:
> >>>> Also; you were going to shop around with the other architectures to see
> >>>> what they want/need for this interface. I see nothing on that.
> >>>>
> >>> I'm open for your suggestion, :)
> >>
> >> Well, we have linux-arch and the various maintainers are also listed in
> >> MAINTAINERS. Go forth and ask..
> >
> > Ok, so I googled a wee bit (you could have too).
> >
> > There's not that many architectures that build big hot chips
> > (powerpc,x86,arm64,s390) (mips, sparc64 and ia64 are pretty dead I
> > think, although the Fujitsu Sparc M10 X+/X SIMD looked like it could be
> > 'fun').
> >
> > Of those, powerpc altivec doesn't seem to be very wide, but you'd have
> > to ask the power folks. Same for s390 z13.
> >
> > The Fujitsu/ARM64-SVE stuff looks like it can be big and hot.
> >
> > And RISC-V has was vector extention, but I don't think anybody is
> > actually building big hot versions of that just yet.
> >
> Thanks Peter. Add more maintainers here.
>
> On some x86 architectures, the tasks using simd instruction(AVX512 particularly)
> need to be dealt with specially against the tasks not using simd instruction.
> I proposed an interface to expose such CPU specific information for the user
> space tools to apply different scheduling policies.
>
> The interface can be refined to be the format as /proc/<pid>/status. Not sure
> if it's useful to any other architectures.
>
> Welcome any comments.
For SVE:
We currently monitor SVE use by trapping only. We also made an ABI
decision that a syscall throws away the task's SVE state -- this
falls out naturally from the fact that the SVE state is caller-save
for regular function calls in the AArch64 ABI.
There isn't an explicit means like VZEROUPPER for userspace to
mark the SVE state as non-live without entering the kernel today.
Currently I expose as little detail to userspace as possible regarding
how/when SVE is enabled/disabled or used.
For the /proc interface:
It would be nice to expose some information to userspace about when/
where major hardware functional units are in use, but beyond the
information already supplied by hardware perf events, it's not
obvious what should be exposed.
AFAICT, the exposed flags would be partly an arbitrary artifact of
kernel implementation details: i.e., how often and when the kernel
saves/restores the task's state may affect the pattern of observed
values in non-trivial ways.
For SVE today, a task that does a lot of syscalls may appear to be using
SVE less than a second task that does fewer syscalls but is otherwise
identical -- simply because a syscall is our only way to detect that
SVE is not in use today.
This kind of issue means that userspace may struggle to make good
decisions using this data: instead it's going to rely on some kind of
tuning which may become wrong as soon as the workload, kernel version
or hardware changes.
A /proc/<pid>/file would need to be polled (which doesn't sound great)
and also suffers from all the usual /proc raciness.
Cheers
---Dave
next prev parent reply other threads:[~2018-11-23 17:11 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-14 23:00 [PATCH v3 1/2] x86/fpu: track AVX-512 usage of tasks Aubrey Li
2018-11-14 23:00 ` [PATCH v3 2/2] proc: add /proc/<pid>/arch_state Aubrey Li
2018-11-15 15:18 ` Dave Hansen
2018-11-16 0:32 ` Li, Aubrey
2018-11-19 17:39 ` Peter Zijlstra
2018-11-21 1:39 ` Li, Aubrey
2018-11-21 8:19 ` Peter Zijlstra
2018-11-21 9:53 ` Peter Zijlstra
2018-11-21 17:12 ` Palmer Dabbelt
2018-11-22 1:40 ` Li, Aubrey
2018-11-23 17:11 ` Dave Martin [this message]
2018-11-15 15:40 ` [PATCH v3 1/2] x86/fpu: track AVX-512 usage of tasks Dave Hansen
2018-11-16 0:21 ` Li, Aubrey
2018-11-16 1:04 ` Dave Hansen
2018-11-16 23:10 ` Dave Hansen
2018-11-17 0:36 ` 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=20181123171102.GI3505@e103592.cambridge.arm.com \
--to=dave.martin@arm.com \
--cc=ak@linux.intel.com \
--cc=arjan@linux.intel.com \
--cc=aubrey.li@intel.com \
--cc=aubrey.li@linux.intel.com \
--cc=benh@kernel.crashing.org \
--cc=catalin.marinas@arm.com \
--cc=dave.hansen@intel.com \
--cc=heiko.carstens@de.ibm.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.org \
--cc=peterz@infradead.org \
--cc=schwidefsky@de.ibm.com \
--cc=tglx@linutronix.de \
--cc=tim.c.chen@linux.intel.com \
--cc=will.deacon@arm.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