Re: [patch 1/1] softirq: improve preempt count error message

From: Ingo Molnar
Date: Tue Oct 05 2010 - 03:46:09 EST



* akpm@xxxxxxxxxxxxxxxxxxxx <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:

> From: Jiri Slaby <jslaby@xxxxxxx>
>
> * add a space after the action
> * print function name instead of address of action (%p->%pf)
>
> Signed-off-by: Jiri Slaby <jslaby@xxxxxxx>
> Cc: Ingo Molnar <mingo@xxxxxxx>
> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> ---
>
> kernel/softirq.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff -puN kernel/softirq.c~softirq-improve-preempt-count-error-message kernel/softirq.c
> --- a/kernel/softirq.c~softirq-improve-preempt-count-error-message
> +++ a/kernel/softirq.c
> @@ -219,8 +219,8 @@ restart:
> h->action(h);
> trace_softirq_exit(h, softirq_vec);
> if (unlikely(prev_count != preempt_count())) {
> - printk(KERN_ERR "huh, entered softirq %td %s %p"
> - "with preempt_count %08x,"
> + printk(KERN_ERR "huh, entered softirq %td %s "
> + "%pf with preempt_count %08x,"
> " exited with %08x?\n", h - softirq_vec,
> softirq_to_name[h - softirq_vec],
> h->action, prev_count, preempt_count());

Please fix the cause of the bug as well: i think this whole block of
debug checks should move into a softirq_debug_check(h, prev_count)
helper inline function - that would clean up the insane printk line
which is currently spread out on 5 lines ...

It would also make __do_softirq() more readable.

Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/