[PATCH v5 0/4] ARM: vfp: Introduce vfp_lock() for VFP locking.
Russell King (Oracle)
linux at armlinux.org.uk
Fri Jun 28 07:07:37 PDT 2024
On Fri, Jun 28, 2024 at 03:46:15PM +0200, Sebastian Andrzej Siewior wrote:
> There was a bug report on PREEMPT_RT which made me look into VFP locking
> on ARM. The usage of local_bh_disable() to ensure exclusive access to
> the VFP unit is not working on PREEMPT_RT because the softirq context is
> preemptible.
>
> This series introduces vfp_lock() which does the right thing.
I disagre with the term "lock" here - it isn't about any kind of
locking, it's about:
1. preventing the thread moving onto a different CPU
2. preventing kernel-mode usage of VFP while a VFP fault is being
handled (and thus changing the VFP state.)
The proble with "lock" is that it makes it look like this code is
single-threaded which it isn't. Many CPUs can be processing a VFP
fault at the same time - remembering that each CPU has their own
VFP unit.
Maybe name it vfp_state_hold() ... vfp_state_release() instead?
Hold as in "don't let anything interfere with the state we are
going to be accessing".
I'm open to better names if anyone can think of any!
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
More information about the linux-arm-kernel
mailing list