Re: [PATCH RT] arm64: fpsimd: use a local_lock() in addition to local_bh_disable()

From: Sebastian Andrzej Siewior
Date: Tue May 22 2018 - 12:39:38 EST


On 2018-05-22 13:24:29 [-0400], Steven Rostedt wrote:
> On Tue, 22 May 2018 19:21:16 +0200
> Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx> wrote:
>
> > On 2018-05-22 13:10:04 [-0400], Steven Rostedt wrote:
> > > On Thu, 17 May 2018 14:40:06 +0200
> > > Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx> wrote:
> > >
> > > > +static DEFINE_LOCAL_IRQ_LOCK(fpsimd_lock);
> > > > /*
> > > > * Update current's FPSIMD/SVE registers from thread_struct.
> > > > *
> > > > @@ -594,6 +595,7 @@ int sve_set_vector_length(struct task_struct *task,
> > > > * non-SVE thread.
> > > > */
> > > > if (task == current) {
> > > > + local_lock(fpsimd_lock);
> > > > local_bh_disable();
> > >
> > > I'm surprised that we don't have a "local_lock_bh()"?
> >
> > right. Like the last time when we introduced a global lock with no
> > locking context?
> >
>
> I meant, we could have local_lock_bh(fpsimd_lock); that would turn into
> a local_bh_disable() when !PREEMPT_RT.

Oh that part. That could be possible I guess. I need to look into the
second part which disables preemption while the FPU is taken.

> -- Steve

Sebastian