All of lore.kernel.org
 help / color / mirror / Atom feed
From: triegel@redhat.com (Torvald Riegel)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 00/29] arm64: Scalable Vector Extension core support
Date: Mon, 05 Dec 2016 23:42:19 +0100	[thread overview]
Message-ID: <1480977739.14990.250.camel@redhat.com> (raw)
In-Reply-To: <20161130120654.GJ1574@e103592.cambridge.arm.com>

On Wed, 2016-11-30 at 12:06 +0000, Dave Martin wrote:
> So, my key goal is to support _per-process_ vector length control.
> 
> From the kernel perspective, it is easiest to achieve this by providing
> per-thread control since that is the unit that context switching acts
> on.
> 
> How useful it really is to have threads with different VLs in the same
> process is an open question.  It's theoretically useful for runtime
> environments, which may want to dispatch code optimised for different
> VLs

What would be the primary use case(s)?  Vectorization of short vectors
(eg, if having an array of structs or sth like that)?

> -- changing the VL on-the-fly within a single thread is not
> something I want to encourage, due to overhead and ABI issues, but
> switching between threads of different VLs would be more manageable.

So if on-the-fly switching is probably not useful, that would mean we
need special threads for the use cases.  Is that a realistic assumption
for the use cases?  Or do you primarily want to keep it possible to do
this, regardless of whether there are real use cases now?
I suppose allowing for a per-thread setting of VL could also be added as
a feature in the future without breaking existing code.

> For setcontext/setjmp, we don't save/restore any SVE state due to the
> caller-save status of SVE, and I would not consider it necessary to
> save/restore VL itself because of the no-change-on-the-fly policy for
> this.

Thus, you would basically consider VL changes or per-thread VL as in the
realm of compilation internals?  So, the specific size for a particular
piece of code would not be part of an ABI?

> I'm not familiar with resumable functions/executors -- are these in
> the C++ standards yet (not that that would cause me to be familiar
> with them... ;)  Any implementation of coroutines (i.e.,
> cooperative switching) is likely to fall under the "setcontext"
> argument above.

These are not part of the C++ standard yet, but will appear in TSes.
There are various features for which implementations would be assumed to
use one OS thread for several tasks, coroutines, etc.  Some of them
switch between these tasks or coroutines while these are running,
whereas the ones that will be in C++17 only run more than parallel task
on the same OS thread but one after the other (like in a thread pool).

However, if we are careful not to expose VL or make promises about it,
this may just end up being a detail similar to, say, register
allocation, which isn't exposed beyond the internals of a particular
compiler either.
Exposing it as a feature the user can set without messing with the
implementation would introduce additional thread-specific state, as
Florian said.  This might not be a show-stopper by itself, but the more
thread-specific state we have the more an implementation has to take
care of or switch, and the higher the runtime costs are.  C++17 already
makes weaker promises for TLS for parallel tasks, so that
implementations don't have to run TLS constructors or destructors just
because a small parallel task was executed.

  parent reply	other threads:[~2016-12-05 22:42 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-25 19:38 [RFC PATCH 00/29] arm64: Scalable Vector Extension core support Dave Martin
2016-11-25 19:38 ` [RFC PATCH 01/29] arm64: signal: Refactor sigcontext parsing in rt_sigreturn Dave Martin
2016-11-25 19:38 ` [RFC PATCH 02/29] arm64: signal: factor frame layout and population into separate passes Dave Martin
2016-11-25 19:38 ` [RFC PATCH 03/29] arm64: signal: factor out signal frame record allocation Dave Martin
2016-11-25 19:38 ` [RFC PATCH 04/29] arm64: signal: Allocate extra sigcontext space as needed Dave Martin
2016-11-25 19:38 ` [RFC PATCH 05/29] arm64: signal: Parse extra_context during sigreturn Dave Martin
2016-11-25 19:38 ` [RFC PATCH 06/29] arm64: efi: Add missing Kconfig dependency on KERNEL_MODE_NEON Dave Martin
2016-11-25 20:25   ` Ard Biesheuvel
2016-11-25 19:38 ` [RFC PATCH 07/29] arm64/sve: Allow kernel-mode NEON to be disabled in Kconfig Dave Martin
2016-11-25 19:38 ` [RFC PATCH 08/29] arm64/sve: Low-level save/restore code Dave Martin
2016-11-25 19:38 ` [RFC PATCH 09/29] arm64/sve: Boot-time feature detection and reporting Dave Martin
2016-11-25 19:38 ` [RFC PATCH 10/29] arm64/sve: Boot-time feature enablement Dave Martin
2016-11-25 19:38 ` [RFC PATCH 11/29] arm64/sve: Expand task_struct for Scalable Vector Extension state Dave Martin
2016-11-25 19:39 ` [RFC PATCH 12/29] arm64/sve: Save/restore SVE state on context switch paths Dave Martin
2016-11-25 19:39 ` [RFC PATCH 13/29] arm64/sve: Basic support for KERNEL_MODE_NEON Dave Martin
2016-11-25 20:45   ` Ard Biesheuvel
2016-11-26 11:30     ` Catalin Marinas
2016-11-28 11:47       ` Dave Martin
2016-11-28 12:06         ` Catalin Marinas
2016-11-28 12:29           ` Dave Martin
2016-12-06 15:36             ` Ard Biesheuvel
2016-11-25 19:39 ` [RFC PATCH 14/29] Revert "arm64/sve: Allow kernel-mode NEON to be disabled in Kconfig" Dave Martin
2016-11-25 19:39 ` [RFC PATCH 15/29] arm64/sve: Restore working FPSIMD save/restore around signals Dave Martin
2016-11-25 19:39 ` [RFC PATCH 16/29] arm64/sve: signal: Add SVE state record to sigcontext Dave Martin
2016-11-25 19:39 ` [RFC PATCH 17/29] arm64/sve: signal: Dump Scalable Vector Extension registers to user stack Dave Martin
2016-11-25 19:39 ` [RFC PATCH 18/29] arm64/sve: signal: Restore FPSIMD/SVE state in rt_sigreturn Dave Martin
2016-11-25 19:39 ` [RFC PATCH 19/29] arm64/sve: Avoid corruption when replacing the SVE state Dave Martin
2016-11-25 19:39 ` [RFC PATCH 20/29] arm64/sve: traps: Add descriptive string for SVE exceptions Dave Martin
2016-11-25 19:39 ` [RFC PATCH 21/29] arm64/sve: Enable SVE on demand for userspace Dave Martin
2016-11-25 19:39 ` [RFC PATCH 22/29] arm64/sve: Implement FPSIMD-only context for tasks not using SVE Dave Martin
2016-11-25 19:39 ` [RFC PATCH 23/29] arm64/sve: Move ZEN handling to the common task_fpsimd_load() path Dave Martin
2016-11-25 19:39 ` [RFC PATCH 24/29] arm64/sve: Discard SVE state on system call Dave Martin
2016-11-25 19:39 ` [RFC PATCH 25/29] arm64/sve: Avoid preempt_disable() during sigreturn Dave Martin
2016-11-25 19:39 ` [RFC PATCH 26/29] arm64/sve: Avoid stale user register state after SVE access exception Dave Martin
2016-11-25 19:39 ` [RFC PATCH 27/29] arm64/sve: ptrace support Dave Martin
2016-11-25 19:39 ` [RFC PATCH 28/29] arm64: KVM: Treat SVE use by guests as undefined instruction execution Dave Martin
2016-11-25 19:39 ` [RFC PATCH 29/29] arm64/sve: Limit vector length to 512 bits by default Dave Martin
2016-11-30  9:56 ` [RFC PATCH 00/29] arm64: Scalable Vector Extension core support Yao Qi
2016-11-30 12:06   ` Dave Martin
2016-11-30 12:22     ` Szabolcs Nagy
2016-11-30 14:10       ` Dave Martin
2016-11-30 12:38     ` Florian Weimer
2016-11-30 13:56       ` Dave Martin
2016-12-01  9:21         ` Florian Weimer
2016-12-01 10:30           ` Dave Martin
2016-12-01 12:19             ` Dave Martin
2016-12-05 10:44             ` Florian Weimer
2016-12-05 11:07               ` Szabolcs Nagy
2016-12-05 15:04               ` Dave Martin
2016-12-02 11:48       ` Dave Martin
2016-12-02 16:34         ` Florian Weimer
2016-12-02 16:59           ` Joseph Myers
2016-12-02 18:21             ` Dave Martin
2016-12-02 21:56               ` Joseph Myers
2016-12-02 21:56     ` Yao Qi
2016-12-05 15:12       ` Dave Martin
2016-12-05 22:42     ` Torvald Riegel [this message]
2016-12-06 14:46       ` Dave Martin
2016-11-30 10:08 ` Florian Weimer
2016-11-30 11:05   ` Szabolcs Nagy
2016-11-30 14:06     ` Dave Martin

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=1480977739.14990.250.camel@redhat.com \
    --to=triegel@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.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.