All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "Christoph Lameter" <clameter@sgi.com>,
	"Michal Piotrowski" <michal.k.k.piotrowski@gmail.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"Cherwin R. Nooitmeer" <cherwin@gmail.com>,
	linux-pcmcia@lists.infradead.org,
	"Robert de Rooy" <robert.de.rooy@gmail.com>,
	"Alan Cox" <alan@redhat.com>, "Tejun Heo" <htejun@gmail.com>,
	sparclinux@vger.kernel.org, "David Miller" <davem@davemloft.net>,
	"Mikael Pettersson" <mikpe@it.uu.se>,
	linux1394-devel@lists.sourceforge.net,
	"Stefan Richter" <stefanr@s5r6.in-berlin.de>,
	"Kristian Høgsberg" <krh@bitplanet.net>,
	linux-pm@lists.linux-foundation.org,
	"Rafael J. Wysocki" <rjw@sisk.pl>, "Pavel Machek" <pavel@ucw.cz>,
	"Marcus Better" <marcus@better.se>,
	"Andrey Borzenkov" <arvidjaar@mail.ru>,
	linux-usb-devel@lists.sourceforge.net,
	"Greg Kroah-Hartman" <gregkh@suse.de>
Subject: Re: [2/3] 2.6.22-rc2: known regressions v2
Date: Thu, 24 May 2007 19:37:40 +0000	[thread overview]
Message-ID: <20070524193740.GA6787@elte.hu> (raw)
In-Reply-To: <alpine.LFD.0.98.0705241007290.26602@woody.linux-foundation.org>


* Linus Torvalds <torvalds@linux-foundation.org> wrote:

> > Looks like this is in DRM code:
> > 
> > BUG: at include/linux/slub_def.h:88 kmalloc_index()
> 
> I'm going to change that "BUG:" to "WARNING:".
> 
> I know some people disagreed with it (ie Ingo), but I think that's 
> total and utter bullshit.
> 
> It's a warning. Right now that "BUG:" message makes people all scared 
> about something that is not fatal at all, just a note that something 
> hasn't been converted, but is expected to work absolutely fine.
> 
> Calling it a bug is idiotic.

i very much agree that this kmalloc_index() one shouldnt be called a 
"BUG: ", but if you look at the majority of WARN_ON() instances they are 
checks for clear, serious kernel bugs. Very often we use WARN_ON() not 
to signal that it's just a harmless warning, but because we do not want 
to bring the system down via a BUG_ON(). The API is misnamed for sure, 
but still, the purpose and current practice is clear: to signal kernel 
bugs.

To quantify this a bit more objectively i just did a "grep WARN_ON 
kernel/*.c" and randomly picked 10 out of the 113 WARN_ON()'s:

 kernel/cpu.c:			WARN_ON(1);
 kernel/exit.c:	WARN_ON(atomic_read(&tsk->fs_excl));
 kernel/fork.c:	WARN_ON(!(tsk->exit_state & (EXIT_DEAD | EXIT_ZOMBIE)));
 kernel/futex.c:	WARN_ON(!pi_state);
 kernel/hrtimer.c:		WARN_ON_ONCE(timer->cb_mode =  HRTIMER_CB_IRQSAFE_NO_SOFTIRQ);
 kernel/lockdep.c:		WARN_ON(1);
 kernel/mutex-debug.c:	DEBUG_LOCKS_WARN_ON(list_empty(&waiter->list));
 kernel/rtmutex.c:	WARN_ON(rt_mutex_is_locked(lock));
 kernel/sched.c:	if (DEBUG_LOCKS_WARN_ON((preempt_count() < 0)))
 kernel/softirq.c:       WARN_ON_ONCE(in_irq());

and reviewed each instance, each and every one of these warnings is a 
serious kernel bug that i would not 'warn' about, but what i'd like to 
see reported ASAP. [ In fact i added 5 of these WARN_ON()s :-/ ] But 
maybe that's just me?

now regarding the naming of this API, i'd very much agree to do this 
rename:

   WARN_ON  =>  BUG_ON
   BUG_ON   =>  CRASH_ON

and make WARN_ON() print a "WARNING: ".

and i signalled this in the original discussion too a few months ago 
when i opposed the watering-down of the WARN_ON printk.

OTOH i dont feel that strongly about all this :-)

	Ingo

WARNING: multiple messages have this Message-ID (diff)
From: Ingo Molnar <mingo@elte.hu>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "Christoph Lameter" <clameter@sgi.com>,
	"Michal Piotrowski" <michal.k.k.piotrowski@gmail.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"Cherwin R. Nooitmeer" <cherwin@gmail.com>,
	linux-pcmcia@lists.infradead.org,
	"Robert de Rooy" <robert.de.rooy@gmail.com>,
	"Alan Cox" <alan@redhat.com>, "Tejun Heo" <htejun@gmail.com>,
	sparclinux@vger.kernel.org, "David Miller" <davem@davemloft.net>,
	"Mikael Pettersson" <mikpe@it.uu.se>,
	linux1394-devel@lists.sourceforge.net,
	"Stefan Richter" <stefanr@s5r6.in-berlin.de>,
	"Kristian Høgsberg" <krh@bitplanet.net>,
	linux-pm@lists.linux-foundation.org,
	"Rafael J. Wysocki" <rjw@sisk.pl>, "Pavel Machek" <pavel@ucw.cz>,
	"Marcus Better" <marcus@better.se>,
	"Andrey Borzenkov" <arvidjaar@mail.ru>,
	linux-usb-devel@lists.sourceforge.net,
	"Greg Kroah-Hartman" <gregkh@suse.de>
Subject: Re: [2/3] 2.6.22-rc2: known regressions v2
Date: Thu, 24 May 2007 21:37:40 +0200	[thread overview]
Message-ID: <20070524193740.GA6787@elte.hu> (raw)
In-Reply-To: <alpine.LFD.0.98.0705241007290.26602@woody.linux-foundation.org>


* Linus Torvalds <torvalds@linux-foundation.org> wrote:

> > Looks like this is in DRM code:
> > 
> > BUG: at include/linux/slub_def.h:88 kmalloc_index()
> 
> I'm going to change that "BUG:" to "WARNING:".
> 
> I know some people disagreed with it (ie Ingo), but I think that's 
> total and utter bullshit.
> 
> It's a warning. Right now that "BUG:" message makes people all scared 
> about something that is not fatal at all, just a note that something 
> hasn't been converted, but is expected to work absolutely fine.
> 
> Calling it a bug is idiotic.

i very much agree that this kmalloc_index() one shouldnt be called a 
"BUG: ", but if you look at the majority of WARN_ON() instances they are 
checks for clear, serious kernel bugs. Very often we use WARN_ON() not 
to signal that it's just a harmless warning, but because we do not want 
to bring the system down via a BUG_ON(). The API is misnamed for sure, 
but still, the purpose and current practice is clear: to signal kernel 
bugs.

To quantify this a bit more objectively i just did a "grep WARN_ON 
kernel/*.c" and randomly picked 10 out of the 113 WARN_ON()'s:

 kernel/cpu.c:			WARN_ON(1);
 kernel/exit.c:	WARN_ON(atomic_read(&tsk->fs_excl));
 kernel/fork.c:	WARN_ON(!(tsk->exit_state & (EXIT_DEAD | EXIT_ZOMBIE)));
 kernel/futex.c:	WARN_ON(!pi_state);
 kernel/hrtimer.c:		WARN_ON_ONCE(timer->cb_mode ==  HRTIMER_CB_IRQSAFE_NO_SOFTIRQ);
 kernel/lockdep.c:		WARN_ON(1);
 kernel/mutex-debug.c:	DEBUG_LOCKS_WARN_ON(list_empty(&waiter->list));
 kernel/rtmutex.c:	WARN_ON(rt_mutex_is_locked(lock));
 kernel/sched.c:	if (DEBUG_LOCKS_WARN_ON((preempt_count() < 0)))
 kernel/softirq.c:       WARN_ON_ONCE(in_irq());

and reviewed each instance, each and every one of these warnings is a 
serious kernel bug that i would not 'warn' about, but what i'd like to 
see reported ASAP. [ In fact i added 5 of these WARN_ON()s :-/ ] But 
maybe that's just me?

now regarding the naming of this API, i'd very much agree to do this 
rename:

   WARN_ON  =>  BUG_ON
   BUG_ON   =>  CRASH_ON

and make WARN_ON() print a "WARNING: ".

and i signalled this in the original discussion too a few months ago 
when i opposed the watering-down of the WARN_ON printk.

OTOH i dont feel that strongly about all this :-)

	Ingo

  parent reply	other threads:[~2007-05-24 19:37 UTC|newest]

Thread overview: 99+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <46558708.2040803@googlemail.com>
2007-05-24 14:04 ` [2/3] 2.6.22-rc2: known regressions v2 Michal Piotrowski
2007-05-24 14:04 ` Michal Piotrowski
2007-05-24 14:04   ` Michal Piotrowski
2007-05-24 14:18   ` [linux-pm] " Alan Stern
2007-05-24 14:22     ` Michal Piotrowski
2007-05-24 14:18   ` Alan Stern
2007-05-24 17:01   ` Christoph Lameter
2007-05-24 17:01   ` Christoph Lameter
2007-05-24 17:01     ` Christoph Lameter
2007-05-24 17:12     ` Linus Torvalds
2007-05-24 17:12       ` Linus Torvalds
2007-05-24 17:12       ` Linus Torvalds
2007-05-24 17:18       ` Christoph Lameter
2007-05-24 17:18       ` Christoph Lameter
2007-05-24 17:18         ` Christoph Lameter
2007-05-24 18:49       ` Andrew Morton
2007-05-24 18:49         ` Andrew Morton
2007-05-24 18:49         ` Andrew Morton
2007-05-24 19:21         ` Linus Torvalds
2007-05-24 19:21           ` Linus Torvalds
2007-05-24 21:02           ` Jeff Garzik
2007-05-24 21:02             ` Jeff Garzik
2007-05-24 21:02           ` Jeff Garzik
2007-05-24 19:21         ` Linus Torvalds
2007-05-24 19:37       ` Ingo Molnar
2007-05-24 19:37       ` Ingo Molnar [this message]
2007-05-24 19:37         ` Ingo Molnar
2007-05-24 19:50         ` Linus Torvalds
2007-05-24 19:50           ` Linus Torvalds
2007-05-24 19:50           ` Linus Torvalds
2007-05-24 20:02           ` David Woodhouse
2007-05-24 20:02           ` David Woodhouse
2007-05-24 20:02             ` David Woodhouse
2007-05-25 10:11           ` Ingo Molnar
2007-05-25 10:11           ` Ingo Molnar
2007-05-25 10:11             ` Ingo Molnar
2007-05-25 10:18             ` Stefan Richter
2007-05-25 10:18               ` Stefan Richter
2007-05-25 10:18               ` Stefan Richter
2007-05-25 16:21               ` Linus Torvalds
2007-05-25 16:21                 ` Linus Torvalds
2007-05-25 16:21                 ` Linus Torvalds
2007-05-25 11:53             ` Chris Newport
2007-05-25 11:53               ` Chris Newport
2007-05-25 11:53               ` Chris Newport
2007-05-25 12:34               ` Ingo Molnar
2007-05-25 12:34               ` Ingo Molnar
2007-05-25 12:34                 ` Ingo Molnar
2007-05-25 16:33                 ` Andrew Morton
2007-05-25 16:33                   ` Andrew Morton
2007-05-25 16:33                   ` Andrew Morton
2007-05-25 16:45                   ` Christoph Lameter
2007-05-25 16:45                   ` Christoph Lameter
2007-05-25 16:45                     ` Christoph Lameter
2007-05-28  3:46                   ` Vivek Goyal
2007-05-28  3:58                     ` Vivek Goyal
2007-05-28  3:46                     ` Vivek Goyal
2007-05-25 12:40               ` Stefan Richter
2007-05-25 12:40               ` Stefan Richter
2007-05-25 12:40                 ` Stefan Richter
2007-05-25 16:45               ` Linus Torvalds
2007-05-25 16:45                 ` Linus Torvalds
2007-05-25 16:45                 ` Linus Torvalds
2007-05-25 17:03                 ` Alan Cox
2007-05-25 17:03                   ` Alan Cox
2007-05-25 17:03                   ` Alan Cox
2007-05-25 17:19                   ` Linus Torvalds
2007-05-25 17:19                     ` Linus Torvalds
2007-05-25 17:19                     ` Linus Torvalds
2007-05-25 17:37                     ` Andrew Morton
2007-05-25 17:37                       ` Andrew Morton
2007-05-25 17:48                       ` Alan Cox
2007-05-25 17:48                         ` Alan Cox
2007-05-25 17:48                         ` Alan Cox
2007-05-25 17:50                       ` Linus Torvalds
2007-05-25 17:50                         ` Linus Torvalds
2007-05-25 17:50                         ` Linus Torvalds
2007-05-28  4:27                         ` Vivek Goyal
2007-05-28  4:27                         ` Vivek Goyal
2007-05-28  4:39                           ` Vivek Goyal
2007-05-25 17:37                     ` Andrew Morton
2007-05-25 17:07                 ` Chuck Ebbert
2007-05-25 17:07                   ` Chuck Ebbert
2007-05-25 17:07                   ` Chuck Ebbert
2007-05-25 17:21                   ` Linus Torvalds
2007-05-25 17:21                     ` Linus Torvalds
2007-05-25 17:21                     ` Linus Torvalds
2007-05-25 18:03                 ` Chris Newport
2007-05-25 18:03                 ` Chris Newport
2007-05-25 18:03                   ` Chris Newport
2007-05-25 20:36                   ` David Miller
2007-05-25 20:36                   ` David Miller
2007-05-25 20:36                     ` David Miller
2007-05-26 13:16                   ` Matt Sealey
2007-05-26 13:16                   ` [linux-pm] " Matt Sealey
2007-05-26 13:16                     ` Matt Sealey
2007-06-03  6:47   ` Stefan Richter
2007-05-24 14:04 ` [3/3] " Michal Piotrowski
2007-05-24 22:04   ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070524193740.GA6787@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@linux-foundation.org \
    --cc=alan@redhat.com \
    --cc=arvidjaar@mail.ru \
    --cc=cherwin@gmail.com \
    --cc=clameter@sgi.com \
    --cc=davem@davemloft.net \
    --cc=gregkh@suse.de \
    --cc=htejun@gmail.com \
    --cc=krh@bitplanet.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pcmcia@lists.infradead.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=linux1394-devel@lists.sourceforge.net \
    --cc=marcus@better.se \
    --cc=michal.k.k.piotrowski@gmail.com \
    --cc=mikpe@it.uu.se \
    --cc=pavel@ucw.cz \
    --cc=rjw@sisk.pl \
    --cc=robert.de.rooy@gmail.com \
    --cc=sparclinux@vger.kernel.org \
    --cc=stefanr@s5r6.in-berlin.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.