From: jbaron@akamai.com (Jason Baron)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 4/4] dynamic_debug: add jump label support
Date: Mon, 13 Jun 2016 16:32:15 -0400 [thread overview]
Message-ID: <575F184F.9010604@akamai.com> (raw)
In-Reply-To: <5640634.eWRyv1HFLD@wuerfel>
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 <jbaron@akamai.com>
>>>>> ---
>>>>
>>>> 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?
--- 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
Thanks,
-Jason
WARNING: multiple messages have this Message-ID (diff)
From: Jason Baron <jbaron@akamai.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: <akpm@linux-foundation.org>, <joe@perches.com>,
<peterz@infradead.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2 4/4] dynamic_debug: add jump label support
Date: Mon, 13 Jun 2016 16:32:15 -0400 [thread overview]
Message-ID: <575F184F.9010604@akamai.com> (raw)
In-Reply-To: <5640634.eWRyv1HFLD@wuerfel>
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 <jbaron@akamai.com>
>>>>> ---
>>>>
>>>> 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?
--- 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
Thanks,
-Jason
next prev parent reply other threads:[~2016-06-13 20:32 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-20 21:16 [PATCH v2 0/4] convert dynamic_debug to use jump labels Jason Baron
2016-05-20 21:16 ` [PATCH v2 1/4] jump_label: remove bug.h, atomic.h dependencies for HAVE_JUMP_LABEL Jason Baron
2016-05-20 21:16 ` [PATCH v2 2/4] powerpc: add explicit #include <asm/asm-compat.h> for jump label Jason Baron
2016-05-20 21:16 ` [PATCH v2 3/4] s390: add explicit <linux/stringify.h> " Jason Baron
2016-05-20 21:16 ` [PATCH v2 4/4] dynamic_debug: add jump label support Jason Baron
2016-06-10 9:54 ` Arnd Bergmann
2016-06-10 15:33 ` Jason Baron
2016-06-13 16:05 ` Arnd Bergmann
2016-06-13 20:23 ` Arnd Bergmann
2016-06-13 20:23 ` Arnd Bergmann
2016-06-13 20:32 ` Jason Baron [this message]
2016-06-13 20:32 ` Jason Baron
2016-07-01 20:45 ` Arnd Bergmann
2016-07-01 20:45 ` Arnd Bergmann
[not found] ` <5786613E.6010509@akamai.com>
2016-07-13 16:03 ` Arnd Bergmann
2016-06-10 21:28 ` Jason Baron
2016-06-10 21:28 ` Jason Baron
2016-07-01 19:30 ` Chris Metcalf
2016-07-01 19:30 ` Chris Metcalf
2016-07-05 20:57 ` Jason Baron
2016-07-05 20:57 ` Jason Baron
2016-07-06 16:52 ` Chris Metcalf
2016-07-06 16:52 ` Chris Metcalf
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=575F184F.9010604@akamai.com \
--to=jbaron@akamai.com \
--cc=linux-arm-kernel@lists.infradead.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.