linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/8] arm64/sve: First steps towards optimizing syscalls
@ 2019-01-18 16:46 Julien Grall
  2019-01-18 16:46 ` [RFC PATCH 1/8] arm64/fpsimd: Update documentation of do_sve_acc Julien Grall
                   ` (7 more replies)
  0 siblings, 8 replies; 12+ messages in thread
From: Julien Grall @ 2019-01-18 16:46 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: tokamoto, Anton.Kirilov, catalin.marinas, will.deacon, oleg,
	Julien Grall, alex.bennee, Dave.Martin, Daniel.Kiss

Hi all,

This is a first attempt to optimize the syscall path when the user
application uses SVE. The patch series is based on v5.0-rc2.

Per the syscall ABI, SVE registers will be unknown after a syscall. In
practice, the kernel will disable SVE and the registers will be zeroed
(except the first 128-bits of each vector) on the next SVE instruction.
In a workload mixing SVE and syscalls, this will result to 2 entry/exit
to the kernel per syscall.

This series aims to avoid the second entry/exit by zeroing the SVE
registers on syscall return with a twist when the task will get
rescheduled.

This implementation will have an impact on application using SVE
only once. SVE will now be turned on until the application terminates
(unless disabling it via ptrace). Cleverer strategies for choosing
between SVE and FPSIMD context switching are possible (see [1]), but
it is difficult to assess the benefit right now. We could improve the
behaviour in the future as a selection of mature hardware platform
emerges that we can benchmark.

It is also possible to optimize the case when the SVE vector-length
is 128-bit (i.e the same size as the FPSIMD vectors). This could be
explored in the future respin of the series.

While developing the series, I have added a series of tracepoint in
the SVE code. They may not be suitable for upstreaming and hence not
included in the series. I can provide them if anyone is interested.

Comments are welcomed.

Best regards,

[1] https://git.sphere.ly/dtc/kernel_moto_falcon/commit/acc207616a91a413a50fdd8847a747c4a7324167

Julien Grall (8):
  arm64/fpsimd: Update documentation of do_sve_acc
  arm64/signal: Update the comment in preserve_sve_context
  arm64/fpsimdmacros: Allow the macro "for" to be used in more cases
  arm64/fpsimdmacros: Introduce a macro to update ZCR_EL1.LEN
  arm64/sve: Implement helper to flush SVE registers
  arm64/sve: Implement helper to load SVE registers from FPSIMD state
  arm64/sve: Don't disable SVE on syscalls return
  arm64/sve: Rework SVE trap access to use TIF_SVE_NEEDS_FLUSH

 arch/arm64/include/asm/fpsimd.h       |  8 +++++
 arch/arm64/include/asm/fpsimdmacros.h | 48 ++++++++++++++++++++------
 arch/arm64/include/asm/thread_info.h  |  5 ++-
 arch/arm64/kernel/entry-fpsimd.S      | 29 ++++++++++++++++
 arch/arm64/kernel/fpsimd.c            | 64 ++++++++++++++++++++++++++++-------
 arch/arm64/kernel/process.c           |  1 +
 arch/arm64/kernel/ptrace.c            |  7 ++++
 arch/arm64/kernel/signal.c            | 17 ++++++++--
 arch/arm64/kernel/syscall.c           | 13 +++----
 9 files changed, 158 insertions(+), 34 deletions(-)

-- 
2.11.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-01-22 16:03 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-18 16:46 [RFC PATCH 0/8] arm64/sve: First steps towards optimizing syscalls Julien Grall
2019-01-18 16:46 ` [RFC PATCH 1/8] arm64/fpsimd: Update documentation of do_sve_acc Julien Grall
2019-01-21 12:13   ` Mark Rutland
2019-01-22 16:03     ` Julien Grall
2019-01-18 16:46 ` [RFC PATCH 2/8] arm64/signal: Update the comment in preserve_sve_context Julien Grall
2019-01-21 12:17   ` Mark Rutland
2019-01-18 16:46 ` [RFC PATCH 3/8] arm64/fpsimdmacros: Allow the macro "for" to be used in more cases Julien Grall
2019-01-18 16:46 ` [RFC PATCH 4/8] arm64/fpsimdmacros: Introduce a macro to update ZCR_EL1.LEN Julien Grall
2019-01-18 16:46 ` [RFC PATCH 5/8] arm64/sve: Implement helper to flush SVE registers Julien Grall
2019-01-18 16:46 ` [RFC PATCH 6/8] arm64/sve: Implement helper to load SVE registers from FPSIMD state Julien Grall
2019-01-18 16:46 ` [RFC PATCH 7/8] arm64/sve: Don't disable SVE on syscalls return Julien Grall
2019-01-18 16:46 ` [RFC PATCH 8/8] arm64/sve: Rework SVE trap access to use TIF_SVE_NEEDS_FLUSH Julien Grall

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).