mbox series

[0/3,REPOST] arm: covert a few spinlock_t locks to raw_spinlock_t

Message ID 20181207102749.15205-1-bigeasy@linutronix.de
Headers show
Series arm: covert a few spinlock_t locks to raw_spinlock_t | expand

Message

Sebastian Andrzej Siewior Dec. 7, 2018, 10:27 a.m. UTC
Hi,

this small series converts a few spinlock_t locks to raw_spinlock_t.
This change makes no difference for !RT but is required for RT.
I added a few acks to first patch since the last repost [0]. Arnd
suggested that it might be best to route patch 1 via the arm-soc tree.
I hope that we can route patch 2 and 3 the same way.

[0] https://lkml.kernel.org/r/20180711110037.12928-1-bigeasy@linutronix.de

Sebastian

Comments

Sebastian Andrzej Siewior Feb. 13, 2019, 8:46 a.m. UTC | #1
On 2018-12-07 11:27:48 [+0100], To linux-arm-kernel@lists.infradead.org wrote:
> From: Yang Shi <yang.shi@linaro.org>
> 
> When running kprobe on -rt kernel, the below bug is caught:
> 
> |BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:931
> |in_atomic(): 1, irqs_disabled(): 128, pid: 14, name: migration/0
> |Preemption disabled at:[<802f2b98>] cpu_stopper_thread+0xc0/0x140
> |CPU: 0 PID: 14 Comm: migration/0 Tainted: G O 4.8.3-rt2 #1
> |Hardware name: Freescale LS1021A
> |[<8025a43c>] (___might_sleep)
> |[<80b5b324>] (rt_spin_lock)
> |[<80b5c31c>] (__patch_text_real)
> |[<80b5c3ac>] (patch_text_stop_machine)
> |[<802f2920>] (multi_cpu_stop)
> 
> Since patch_text_stop_machine() is called in stop_machine() which
> disables IRQ, sleepable lock should be not used in this atomic context,
>  so replace patch_lock to raw lock.
> 
> Signed-off-by: Yang Shi <yang.shi@linaro.org>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
ping

Sebastian
Sebastian Andrzej Siewior Feb. 13, 2019, 8:46 a.m. UTC | #2
On 2018-12-07 11:27:49 [+0100], To linux-arm-kernel@lists.infradead.org wrote:
> Mostly unwind is done with irqs enabled however SLUB may call it with
> irqs disabled while creating a new SLUB cache.
> 
> I had system freeze while loading a module which called
> kmem_cache_create() on init. That means SLUB's __slab_alloc() disabled
> interrupts and then
> 
> ->new_slab_objects()
>  ->new_slab()
>   ->setup_object()
>    ->setup_object_debug()
>     ->init_tracking()
>      ->set_track()
>       ->save_stack_trace()
>        ->save_stack_trace_tsk()
>         ->walk_stackframe()
>          ->unwind_frame()
>           ->unwind_find_idx()
>            =>spin_lock_irqsave(&unwind_lock);
> 
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

ping

Sebastian
Arnd Bergmann Feb. 13, 2019, 3:14 p.m. UTC | #3
On Wed, Feb 13, 2019 at 9:46 AM Sebastian Andrzej Siewior
<bigeasy@linutronix.de> wrote:
>
> On 2018-12-07 11:27:49 [+0100], To linux-arm-kernel@lists.infradead.org wrote:
> > Mostly unwind is done with irqs enabled however SLUB may call it with
> > irqs disabled while creating a new SLUB cache.
> >
> > I had system freeze while loading a module which called
> > kmem_cache_create() on init. That means SLUB's __slab_alloc() disabled
> > interrupts and then
> >
> > ->new_slab_objects()
> >  ->new_slab()
> >   ->setup_object()
> >    ->setup_object_debug()
> >     ->init_tracking()
> >      ->set_track()
> >       ->save_stack_trace()
> >        ->save_stack_trace_tsk()
> >         ->walk_stackframe()
> >          ->unwind_frame()
> >           ->unwind_find_idx()
> >            =>spin_lock_irqsave(&unwind_lock);
> >
> > Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
>
> ping

Patches 2/3 and 3/3 look good to me. Can you add them to
https://www.arm.linux.org.uk/developer/patches/ ?

Reviewed-by: Arnd Bergmann <arnd@arndb.de>

Are there any other ARM specific RT patches that are not yet picked up?

        Arnd
Sebastian Andrzej Siewior Feb. 13, 2019, 3:57 p.m. UTC | #4
On 2019-02-13 16:14:18 [+0100], Arnd Bergmann wrote:
> Patches 2/3 and 3/3 look good to me. Can you add them to
> https://www.arm.linux.org.uk/developer/patches/ ?
> 
> Reviewed-by: Arnd Bergmann <arnd@arndb.de>

Will do, thanks.

> Are there any other ARM specific RT patches that are not yet picked up?

No, not at the moment.

>         Arnd

Sebastian