[lkml]   [2018]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: printk feature for syzbot?
On (05/11/18 11:17), Dmitry Vyukov wrote:
> From what I see, it seems that interrupts can be nested:

Hm, I thought that in general IRQ handlers run with local IRQs
disabled on CPU. So, generally, IRQs don't nest. Was I wrong?
NMIs can nest, that's true; but I thought that at least IRQs

> Will this in_nmi()/in_irq()/in_serving_softirq()/else be enough to
> untangle output printed by such nested interrupts?

Well, hm. __irq_enter() does preempt_count_add(HARDIRQ_OFFSET) and
__irq_exit() does preempt_count_sub(HARDIRQ_OFFSET). So, technically,
you can store

preempt_count() & HARDIRQ_MASK
preempt_count() & SOFTIRQ_MASK
preempt_count() & NMI_MASK

in that extended context tracking. The numbers will not tell you
the IRQ line number, for instance, but at least you'll be able to
distinguish different hard/soft IRQs, NMIs. Just an idea, I didn't
check it, may be it won't work at all.

Ideally, the serial log should be like this

i:1 ... foo()
i:1 ... bar()
i:2 ... foo() // __irq_enter()
i:2 ... bar()
i:2 ... buz() // __irq_exit()
i:1 ... buz()

but I may be completely wrong.

Petr and Steven probably will have better ideas.


 \ /
  Last update: 2018-05-11 11:50    [W:0.172 / U:10.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site