mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	torvalds@linux-foundation.org, davem@davemloft.net,
	arjan@linux.intel.com
Subject: Re: warn: Turn the netdev timeout WARN_ON() into a WARN()
Date: Tue, 16 Sep 2008 23:27:08 -0400	[thread overview]
Message-ID: <20080917032708.GA8431@havoc.gtf.org> (raw)
In-Reply-To: <200809170259.m8H2xClI020907@hera.kernel.org>

On Wed, Sep 17, 2008 at 02:59:12AM +0000, Linux Kernel Mailing List wrote:
>     
>     this patch turns the netdev timeout WARN_ON_ONCE() into a WARN_ONCE(),
>     so that the device and driver names are inside the warning message.
>     This helps automated tools like kerneloops.org to collect the data
>     and do statistics, as well as making it more likely that humans
>     cut-n-paste the important message as part of a bugreport.
>     
>     Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
>     Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
>  
> +#define WARN_ONCE(condition, format...)	({			\
> +	static int __warned;					\
> +	int __ret_warn_once = !!(condition);			\
> +								\
> +	if (unlikely(__ret_warn_once))				\
> +		if (WARN(!__warned, format)) 			\
> +			__warned = 1;				\
> +	unlikely(__ret_warn_once);				\
> +})
> +
>  #define WARN_ON_RATELIMIT(condition, state)			\
>  		WARN_ON((condition) && __ratelimit(state))
>  
> diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
> index 9634091..ec0a083 100644
> --- a/net/sched/sch_generic.c
> +++ b/net/sched/sch_generic.c
> @@ -215,10 +215,9 @@ static void dev_watchdog(unsigned long arg)
>  			    time_after(jiffies, (dev->trans_start +
>  						 dev->watchdog_timeo))) {
>  				char drivername[64];
> -				printk(KERN_INFO "NETDEV WATCHDOG: %s (%s): transmit timed out\n",
> +				WARN_ONCE(1, KERN_INFO "NETDEV WATCHDOG: %s (%s): transmit timed out\n",
>  				       dev->name, netdev_drivername(dev, drivername, 64));
>  				dev->tx_timeout(dev);
> -				WARN_ON_ONCE(1);


hrm, am I misunderstanding?

AFAICS, this change means the user is no longer notified [after
the first time] of a condition they really need to know about --
a hardware or driver bug.

These conditions can occur many hours or days apart, and the admin
needs to know EACH time it occurs, because it is a major networking
event, generally leading to a complete reset of the entire hardware.

And quite honestly, the backtrace is not useful (yes, even the one
that existing previously)...  THINK for a second.  The backtrace
is going to look exactly the same, since it is a timer-triggered
dev_watchdog() call.

NETDEV WATCHDOG timeouts are not easily fixable errors like lockdep
warnings, and the admin really does need to see each one.

Unless I am missing something, (1) this patch should be reverted,
and in additional, (2) I recommend removing the WARN_ON_ONCE()
because the backtrace is not helpful.

	Jeff




       reply	other threads:[~2008-09-17  3:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200809170259.m8H2xClI020907@hera.kernel.org>
2008-09-17  3:27 ` Jeff Garzik [this message]
2008-09-17 13:41   ` Arjan van de Ven
2008-09-17 21:39     ` Jeff Garzik
2008-09-17 21:45       ` Arjan van de Ven
2008-09-17 21:53         ` Jeff Garzik

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=20080917032708.GA8431@havoc.gtf.org \
    --to=jeff@garzik.org \
    --cc=arjan@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®