Development discussion of WireGuard
 help / color / mirror / Atom feed
* Allowing SIMD in kernel mode without disabling preemption
@ 2019-05-18 16:27 Shawn Landden
  0 siblings, 0 replies; only message in thread
From: Shawn Landden @ 2019-05-18 16:27 UTC (permalink / raw)
  To: linux-rt-users, peterz, wireguard

I ported the x86 approach to allowing SIMD in kernel mode, even in an
interrupt, to powerpc[1], but I couldn't help wonder if it would be
possible without disabling preemption.

The scheduler just has to check the per-cpu in_kernel_fpu, and if it
is set, save the fpu state of the kernel thread, similar to what is
done for user-space threads with use_mode().

This way WireGuard would be fast even on preempt-rt kernels (it
currently turns off SIMD on them). Other crypto in the kernel is
woorse, and just unconditionally turns off preempt for each block of
data (look at arch/x86/crypto/chacha_glue.c ). Note that
kernel_fpu_begin() disables preemption, but I don't believe it has to.

Is there any complications with this approach that I am missing?

-Shawn Landden

[1] https://lists.ozlabs.org/pipermail/linuxppc-dev/2019-May/190704.html
_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-05-18 16:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-18 16:27 Allowing SIMD in kernel mode without disabling preemption Shawn Landden

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