Re: [PATCH v4] lib/spinlock_debug.c: prevent a recursive cycle in the debug code
From: Sergey Senozhatsky
Date: Fri Jan 29 2016 - 01:36:16 EST
On (01/29/16 15:16), Sergey Senozhatsky wrote:
>
> http://marc.info/?l=linux-kernel&m=144976121529901
>
hm... I don't like that patch. ->reset() loop must be done outside
of zap_locks(). we can have a printk() recursion in CPU1, but console
driver lock may be owned by CPU2 in driver's handle_IRQ(), for example.
stealing its lock CPU1 is not really good. in my kernels I do this from
panic() path only, where I know that things are already bad.
panic()->console_panic_mode()->{for_each_console()->reset(), zap_locks()}->console_trelock()->console_unlock().
-ss