[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0612060940130.28502@twin.jikos.cz>
Date: Wed, 6 Dec 2006 09:47:48 +0100 (CET)
From: Jiri Kosina <jikos@...os.cz>
To: Ingo Molnar <mingo@...e.hu>
cc: Andrew Morton <akpm@...l.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] let WARN_ON() output the condition
On Wed, 6 Dec 2006, Ingo Molnar wrote:
> a WARN_ON() also triggers a stack dump, which should pinpoint the exact
> location. (especially if combined with kallsyms) For example:
Actually, I was referring to something a little bit different. For example
kernel/mutex.c:__mutex_lock_common() calls spin_lock_mutex() on line 132.
spin_lock_mutex() contains
DEBUG_LOCKS_WARN_ON(in_interrupt()); \
local_irq_save(flags); \
__raw_spin_lock(&(lock)->raw_lock); \
DEBUG_LOCKS_WARN_ON(l->magic != l); \
When one of these two WARN_ONs trigger, we get only
WARNING at kernel/mutex.c:132 __mutex_lock_common()
but it's indistuingishable which of the two WARN_ONs triggered. My patch
turns this into
WARNING (l->magic != l) at kernel/mutex.c:132 __mutex_lock_common()
> side-effects happen regularly in WARN_ON()s and while they should be
> avoided, they are not noticed by the compiler and can cause nasty bugs
> if executed twice. Do we really need this change?
I absolutely don't insist on it to be merged, besides this Andrew also
pointed out non-trivial .text growth. I just cooked it up for myself when
debugging some locking problems and that warning at kernel/mutex.c:132
triggered, and I didn't know which one was the reason.
--
Jiri Kosina
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists