Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755537AbbKWVb1 (ORCPT ); Mon, 23 Nov 2015 16:31:27 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:62384 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751704AbbKWVbY (ORCPT ); Mon, 23 Nov 2015 16:31:24 -0500 From: Arnd Bergmann To: Josh Triplett Cc: linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, rmk@arm.linux.org.uk Subject: Re: [RFC] asm-generic: default BUG_ON(x) to "if(x) BUG()" Date: Mon, 23 Nov 2015 22:30:56 +0100 Message-ID: <4745584.7EJGtZoN8U@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <20151123211748.GA30660@x> References: <5868782.RxZY0W5S4d@wuerfel> <4102055.db40h1joXM@wuerfel> <20151123211748.GA30660@x> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:Gs1yvjdBOxFmfMjUn6D8iKRButPcG8qeUol038rwEz4KE1oZctZ QUe69bhRb4Swrhs4RKuQs0YEvkoUJ3NkC1f8iCPLgDak8qPn1IjucFtWQK4jBe5o7PWKHbW LvIL2hnWh1aX5zY90KFC7+debTOKIsmkAasVjwOIXqmtjTB+h30MwuSYVTYGvj/TpFGpbKa tRmcrvHpE9KzlXPYmbQoQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:NpY93/iI5Pk=:Cj+j/xtuo8kmEr2KVPUzwW KXgbSxhzOgZD6G1NSJaUNoS0NtmAPNi7SD37dtS46pG16UyHA+A0GuPuayQ6ugDomRGNnirvX CxV6yp7os2b100yt/IiI/FXM0iPWZLj5jJBCyMenhK77iuIZ+MkQH9riR0u7Uia+ZIIUp9waf hcMYtZ4L2za9DgiYkQk1lrSPGhhzKOhCxpZFD5TqKkmCCmMhOcBsjo2geaBdHxhhssuDgpNqP ZlNSpTNMZzu6lGZEy7FiDImgkfQJPDdHvJXnqS9/7nv29yiPpzhNNZi9iHgs3NtFic2QdcdIm 0dSZ881F3PaI5sjlwhMmvLMi3AY4R6OWeS3ikKkR/9F77ss10T2p0HYSIumtzq/9TcdnSszDk YwVMBNzFKY+PbpJfSRDrQBJ7L7qG7/5JSiK+9uGnM8PAb7j/qlee9L5c9/asnEeAXGUC/2DlD z9kVpHd4Owq6AF5OgKFvbpLL8BNogOJ1XI7dRkiAjHWtpWGAesqdlkxXR665sLm8Y8Jr+X64n 2NmlD/PUAy85q4eBdec2uKHBrjyvM0T+2NjAzqr8hnYrhCqe/z4YFnCOgCRcYpcZIJd1lHZa2 9zNaSqyNJ7z94+LIjf2NlMidounVPTB7MB+jtfgV1zzhlh7Nkdi9DUNEynATDmxG+0pUFXZ1R I59e3rXrWfVhMdqWPQsYmYBt+Zx4pNTraRT/nREJSAyryvikDLi9t1ADLwmx2yLIG+VNpj0kE p9VLJm8HpFqSzT/M Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2557 Lines: 66 On Monday 23 November 2015 13:17:48 Josh Triplett wrote: > > not sure where I can find tinyconfig, > > "make tinyconfig" in the standard kernel tree. It turns on a few > options that make the kernel even smaller. I should learn how that works. We have way too many configuration files on ARM and it would be nice to use Kconfig fragments to simplify it a little for things like enabling LPAE or big-endian. The kernelci.org folks do that already, but it's not in mainline. FWIW, on tinyconfig, the __modver section remains at 1784 with or without my patch, and the size difference with my patch applied is down to 5412 bytes mostly in .text, around 0.50% of the total size. > > this is what I get for ARM allnoconfig > > (only totals, let me know if you need more details): > > > > original: 961307 > > patched: 969167 (+0.82%) > > CONFIG_BUG: 994695 (+3.36%) > > "patched" here represents allnoconfig with your patch added, but with > CONFIG_BUG still turned off? Correct. > Doesn't seem too bad. Rather large, but I think we ought to fix the > problem by 1) reducing the number of uses of BUG_ON in the kernel, and > 2) compiling out more bits of the kernel entirely, including their calls > to BUG_ON. Eliminating a class of warnings that cause people grief when > trying to build and contribute to tiny kernels seems worth it, at least > for now. Ok > > > > #ifndef HAVE_ARCH_BUG_ON > > > > -#define BUG_ON(condition) do { if (condition) ; } while (0) > > > > +#define BUG_ON(condition) do { if (condition) BUG(); } while (0) > > > > > > This makes BUG_ON in the !CONFIG_BUG case almost identical to the > > > CONFIG_BUG=y case, except for the use of unlikely(condition), which this > > > ought to do as well. > > > > > > Given that, could you pull the definition *out* of the #ifdef/#else for > > > CONFIG_BUG entirely, and define it the same way in both cases? > > > > Yes, I thought about that already and decided to keep the patch simple > > instead. I can do that of course once we get consensus on the general > > approach. > > Looking at the thread, I think you have it at this point. > > And personally I value simplicity of the patched code over simplicity of > the patch. Ok, I'll prepare an updated version with that change. Thanks, Arnd -- 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/