Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1358472
| From | Byungchul Park <byungchul.park@lge.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v6 2/2] printk: Make printing of spin_dump() deferred to avoid a deadlock |
| Date | 2016-03-16 03:10 +0100 |
| Message-ID | <rd94m-2i7-7@gated-at.bofh.it> (permalink) |
| References | (1 earlier) <rbsE9-4Ih-11@gated-at.bofh.it> <rcpEe-5dH-1@gated-at.bofh.it> <rcqAi-5V6-3@gated-at.bofh.it> <rcqAi-5V6-9@gated-at.bofh.it> <rcs93-76J-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, Mar 14, 2016 at 01:17:48PM +0900, Byungchul Park wrote: > On Mon, Mar 14, 2016 at 11:40:55AM +0900, Sergey Senozhatsky wrote: > > Hi, > > > > On (03/14/16 11:30), Byungchul Park wrote: > > [..] > > > > so can it be > > > > > > > > vprintk_emit() > > > > __spin_dump_deferred() > > > > vprintk_deferred() > > > > vprintk_emit() > > > > __spin_dump_deferred() > > > ^^^ > > > can be caused by raw_spin_lock(logbug_lock) > > > > > > > vprintk_deferred() > > > > > > Yes, it can happen by raw_spin_lock(logbuf_lock) to print warning or error > > > message. Are you worrying about an infinite recursion? > > > > yes. > > > > > 1. In the case printing warning, eventually it can fill the buffer without > > > actual printing using console. > > > > so the worry is that the CPU that spins on __spin_dump_deferred() has IRQs > > disabled and `printk_pending' bit set; but IRQ may never be enabled on this > > CPU. > > It's true if another cpu never release the logbug_lock. But it's another > problem which current code already has and must be solved by another way. > IOW, the situation where the logbug_lock is not held yet is not the case > where we need to worry about whether the "IRQ work queue" works or not. To add more explanation, 1. If another cpu never release the logbug_lock, then the both current code and patched code will suffer from an infinite recursive by vprintk_emit -> spin_dump -> vprintk_emit -> ... It should be solved by another way if we define this is a problem (even it's not a problem currently). 2. If another cpu eventually release the logbug_lock, then the both current code and patched code can obtain the lock and get out of the recursive. And the "IRQ work queue" can work when the irq is finally enabled. That's no problem. This is what I wanted to say. > > > > > > 2. In the case printing error, the infinite recursion can be prevented by > > > debug_locks_off(). > > > > > > Therefore, no problem. > > > > -ss
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v6 0/2] Make printing of spin_dump() deferred to avoid a deadlock Byungchul Park <byungchul.park@lge.com> - 2016-03-11 11:40 +0100
[PATCH v6 2/2] printk: Make printing of spin_dump() deferred to avoid a deadlock Byungchul Park <byungchul.park@lge.com> - 2016-03-11 11:40 +0100
Re: [PATCH v6 2/2] printk: Make printing of spin_dump() deferred to avoid a deadlock Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-03-14 02:40 +0100
Re: [PATCH v6 2/2] printk: Make printing of spin_dump() deferred to avoid a deadlock Byungchul Park <byungchul.park@lge.com> - 2016-03-14 03:40 +0100
Re: [PATCH v6 2/2] printk: Make printing of spin_dump() deferred to avoid a deadlock Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-03-14 03:40 +0100
Re: [PATCH v6 2/2] printk: Make printing of spin_dump() deferred to avoid a deadlock Byungchul Park <byungchul.park@lge.com> - 2016-03-14 05:20 +0100
Re: [PATCH v6 2/2] printk: Make printing of spin_dump() deferred to avoid a deadlock Byungchul Park <byungchul.park@lge.com> - 2016-03-16 03:10 +0100
[PATCH v6 1/2] printk: Factor out buffering and irq work queuing in printk_deferred Byungchul Park <byungchul.park@lge.com> - 2016-03-11 11:40 +0100
Re: [PATCH v6 1/2] printk: Factor out buffering and irq work queuing in printk_deferred Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-03-14 02:30 +0100
Re: [PATCH v6 1/2] printk: Factor out buffering and irq work queuing in printk_deferred Byungchul Park <byungchul.park@lge.com> - 2016-03-14 05:50 +0100
csiph-web