[PATCH] arm64/sve: Make kernel FPU protection RT friendly

Dave Martin Dave.Martin at arm.com
Thu Jul 29 09:32:27 PDT 2021


On Thu, Jul 29, 2021 at 06:07:56PM +0200, Sebastian Andrzej Siewior wrote:
> On 2021-07-29 18:00:31 [+0200], To Dave Martin wrote:
> > 
> > But I get what you mean. I'm just not sure regarding the naming since
> > the code behaves the same on x86 and arm64 here.
> 
> Assuming that everyone follows this pattern what about
>   fpregs_lock()
>   fpregs_unlock()

I'm not sure about the "fpregs".  This is really about CPU-local
resources that are contended between softirq and task context.

Some arches might not to use fp in softirq context and then their fp
regs wouldn't need this; others might have other resources that aren't
"fp" regs, but are contended in the same way.


My "local_bh" was meaning purely softirqs running on this CPU.  This was
the original meaning of "local" in this API IIUC.  This is one reason
why they must disable preemption: "local" is meaningless if preemption
is enabled, since otherwise we might randomly migrate between CPUs.

I guess the "local" was preserved in the naming on PREEMPT_RT to reduce
the amount of noise that would have resulted from a treewide rename, but
this word seems confusing if there is no CPU-localness involved.


In this particular case, we really do want to bind ourselves onto the
current CPU and disable softirqs on this CPU -- if they continue to run
elsewhere, that's just fine.

What do you think about:

get_bh_cpu_context()
put_bh_cpu_context()

or something along those lines?

Cheers
---Dave



More information about the linux-arm-kernel mailing list