From patchwork Mon Jun 13 20:32:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Baron X-Patchwork-Id: 9174249 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EC4A46044F for ; Mon, 13 Jun 2016 20:34:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D36A42012F for ; Mon, 13 Jun 2016 20:34:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C635120223; Mon, 13 Jun 2016 20:34:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BFA7020499 for ; Mon, 13 Jun 2016 20:34:21 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1bCYXK-0001QF-KG; Mon, 13 Jun 2016 20:32:42 +0000 Received: from prod-mail-xrelay05.akamai.com ([23.79.238.179]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1bCYXH-0001OM-44 for linux-arm-kernel@lists.infradead.org; Mon, 13 Jun 2016 20:32:40 +0000 Received: from prod-mail-xrelay05.akamai.com (localhost.localdomain [127.0.0.1]) by postfix.imss70 (Postfix) with ESMTP id 7A10D3F4001; Mon, 13 Jun 2016 20:32:16 +0000 (GMT) Received: from prod-mail-relay11.akamai.com (prod-mail-relay11.akamai.com [172.27.118.250]) by prod-mail-xrelay05.akamai.com (Postfix) with ESMTP id 62D934E85E; Mon, 13 Jun 2016 20:32:16 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akamai.com; s=a1; t=1465849936; bh=pxCzGxeSC2uir+RgzOhximltbiSRWYmob35PKhDfkfw=; l=2605; h=To:References:CC:From:Date:In-Reply-To:From; b=PzyI554MeFF3ta5RE0c4stXtX9nXi2NqqiSo2+RyUF3+XhB79wpWxWegftQ+M/nTT 24KoB4NqDc/rKmL7UV3XYYeD1pi8SZJEDPvqyK9pqXtNQZuCYgPlO2GwzreJypibEn 76izHVxPgf4ygRU0pKMhvvLih/i+t9nEGeB8ZZt8= Received: from email.msg.corp.akamai.com (usma1ex-casadmn.msg.corp.akamai.com [172.27.123.33]) by prod-mail-relay11.akamai.com (Postfix) with ESMTP id 5F3181FC88; Mon, 13 Jun 2016 20:32:16 +0000 (GMT) Received: from USMA1EX-CAS3.msg.corp.akamai.com (172.27.123.32) by usma1ex-dag1mb1.msg.corp.akamai.com (172.27.123.101) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Mon, 13 Jun 2016 16:32:15 -0400 Received: from [172.28.12.139] (172.28.12.139) by USMA1EX-CAS3.msg.corp.akamai.com (172.27.123.32) with Microsoft SMTP Server id 15.0.1130.7 via Frontend Transport; Mon, 13 Jun 2016 16:32:15 -0400 Subject: Re: [PATCH v2 4/4] dynamic_debug: add jump label support To: Arnd Bergmann References: <575ADDB3.7070304@akamai.com> <3448491.s2zXTXrSlh@wuerfel> <5640634.eWRyv1HFLD@wuerfel> From: Jason Baron Message-ID: <575F184F.9010604@akamai.com> Date: Mon, 13 Jun 2016 16:32:15 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <5640634.eWRyv1HFLD@wuerfel> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160613_133239_342025_34DFE769 X-CRM114-Status: GOOD ( 14.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: joe@perches.com, peterz@infradead.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On 06/13/2016 04:23 PM, Arnd Bergmann wrote: > On Monday, June 13, 2016 6:05:22 PM CEST Arnd Bergmann wrote: >> On Friday, June 10, 2016 11:33:07 AM CEST Jason Baron wrote: >>> On 06/10/2016 05:54 AM, Arnd Bergmann wrote: >>>> On Friday, May 20, 2016 5:16:36 PM CEST Jason Baron wrote: >>>>> Although dynamic debug is often only used for debug builds, sometimes its >>>>> enabled for production builds as well. Minimize its impact by using jump >>>>> labels. This reduces the text section by 7000+ bytes in the kernel image >>>>> below. It does increase data, but this should only be referenced when >>>>> changing the direction of the branches, and hence usually not in cache. >>>>> >>>>> text data bss dec hex filename >>>>> 8194852 4879776 925696 14000324 d5a0c4 vmlinux.pre >>>>> 8187337 4960224 925696 14073257 d6bda9 vmlinux.post >>>>> >>>>> Signed-off-by: Jason Baron >>>>> --- >>>> >>>> This causes problems for some of my randconfig builds, when a dynamic >>>> debug call is used inside of an __exit function: >>>> >>>> `.exit.text' referenced in section `__jump_table' of drivers/built-in.o: defined in discarded section `.exit.text' of drivers/built-in.o >>>> `.exit.text' referenced in section `__jump_table' of drivers/built-in.o: defined in discarded section `.exit.text' of drivers/built-in.o >>>> >>> >>> I stuck pr_debug() in a few functions marked with __exit, but did not >>> reproduce yet. Can you share your .config and gcc --version. >>> >> >> I found these on ARM randconfig builds e.g. this one >> http://pastebin.com/raw/KjWHxnwU >> >> I also have some other patches applied that could have interacted with your >> change, so if you can't reproduce it easily, let me try it on a plain linux-next >> kernel. >> >> The compiler I use is arm-linux-gnueabi-gcc (GCC) 6.0.0 20160323 (experimental) > > Update: on ARM, I have been able to reproduce this with gcc-4.6 > and gcc-4.8, so I'm pretty confident that this is independent of the > toolchain. However, I have so far failed to reproduce this on x86. > > Looking at the exit_ceph() function, I get these two assembly outputs, > ARM fails with the link error above: > ok, does this fix things up? Thanks, -Jason --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S @@ -44,7 +44,7 @@ #endif #if (defined(CONFIG_SMP_ON_UP) && !defined(CONFIG_DEBUG_SPINLOCK)) || \ - defined(CONFIG_GENERIC_BUG) + defined(CONFIG_GENERIC_BUG) || defined(CONFIG_JUMP_LABEL) #define ARM_EXIT_KEEP(x) x #define ARM_EXIT_DISCARD(x) #else