Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932433AbbFHJLo (ORCPT ); Mon, 8 Jun 2015 05:11:44 -0400 Received: from mail-wi0-f177.google.com ([209.85.212.177]:37260 "EHLO mail-wi0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932094AbbFHJLh (ORCPT ); Mon, 8 Jun 2015 05:11:37 -0400 Date: Mon, 8 Jun 2015 11:11:32 +0200 From: Ingo Molnar To: Alexander Holler Cc: Richard Weinberger , Linus Torvalds , Tejun Heo , Louis Langholtz , Linux Kernel Mailing List , Trivial patch monkey , Rusty Russell , Andrew Morton , Peter Zijlstra , Thomas Gleixner , Greg Kroah-Hartman Subject: Re: [PATCH] debug: Deprecate BUG_ON() use in new code, introduce CRASH_ON() Message-ID: <20150608091132.GA19566@gmail.com> References: <1433721270-9182-1-git-send-email-lou_langholtz@me.com> <20150608000007.GA3543@mtj.duckdns.org> <20150608071215.GA369@gmail.com> <557546E6.5030304@ahsoftware.de> <5575558E.5070706@ahsoftware.de> <20150608090509.GA19160@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150608090509.GA19160@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1344 Lines: 34 * Ingo Molnar wrote: > Firstly, the changelog of the patch that Greg rejected told nothing about all > that thinking, so at minimum it's a deficient changelog. > > Secondly and more importantly, instead of doing a BUG_ON() you could have done: > > if (WARN_ON_ONCE(port->itty)) > return; > > This would probably have prevented the tty related memory corruption just as > much, at the cost of a (small and infrequent) memory leak. > > I.e. instead of crashing the machine, you need to try to find the least > destructive approach if a bug is detected. Also note that BUG_ON() will make data corruption _worse_ statistically. Why? Because most data corruptions are unlikely to be perfectly detected by a BUG_ON(), and the BUG_ON() delays the finding of the underlying bug, so the bug will hit more people before it's fixed for good. So even in the cases where you could argue that the system needs to stop, because we have evidence of data corruption, it's statistically the better approach to continue and get kernel log info back to developers. Thanks, Ingo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/