From: Helge Deller <deller@gmx.de>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: linux-parisc@vger.kernel.org
Subject: Re: [RFC] fix the relative jump problem on large modules
Date: Fri, 18 Jun 2010 22:40:25 +0200 [thread overview]
Message-ID: <4C1BD9B9.200@gmx.de> (raw)
In-Reply-To: <1276873407.2850.35.camel@mulgrave.site>
On 06/18/2010 05:03 PM, James Bottomley wrote:
> Part of this arguing with ksplice about their plan for
> -ffunction-sections and -fdata-sections got me thinking about how we do
> modules. Right at the moment we have one section for every function in
> a module, which leads to a massive amount of relocation overhead in the
> in-kernel module loader. Plus for some modules (ipv6, I believe), we
> lack the relative jumps to get out of the function because we only put
> the stubs after all the text sections.
>
> The way to fix all of this, I think, is to make the real linker do more
> work. It should be beneficial to us because the linker *should* be able
> to rearrange the sections to get the maximum number of jumps satisfiable
> relatively.
>
> I've tested that this works on pa8800 systems, but I'd really like
> someone to try a failing module on a 32 bit platform (since 64 bits has
> 22 bit relative jumps, all the modules actually work).
Hi James,
I think there is no failing module on 32bit right now.
The biggest modules were ipv6.ko and xfs.ko, which do work now
since the latest module changes.
But if your patch saves relocations it's a win nevertheless.
I can't test your patch right now, but will try tomorrow evening....
Helge
> You can see some
> of the savings in the scsi_mod.ko
>
> Before: 325 sections, 6366 relocation symbols
> After: 23 sections, 5244 relocation symbols
>
> James
>
> ---
>
> diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile
> index 55cca1d..ab88f11 100644
> --- a/arch/parisc/Makefile
> +++ b/arch/parisc/Makefile
> @@ -21,6 +21,7 @@ KBUILD_DEFCONFIG := default_defconfig
>
> NM = sh $(srctree)/arch/parisc/nm
> CHECKFLAGS += -D__hppa__=1
> +LDFLAGS_MODULE += -T $(srctree)/arch/parisc/kernel/module.lds
>
> MACHINE := $(shell uname -m)
> ifeq ($(MACHINE),parisc*)
> diff --git a/arch/parisc/kernel/module.lds b/arch/parisc/kernel/module.lds
> new file mode 100644
> index 0000000..42ee3eb
> --- /dev/null
> +++ b/arch/parisc/kernel/module.lds
> @@ -0,0 +1,6 @@
> +SECTIONS {
> + .text : {
> + /* Gather all function sections */
> + *(.text.*)
> + }
> +}
next prev parent reply other threads:[~2010-06-18 20:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-18 15:03 [RFC] fix the relative jump problem on large modules James Bottomley
2010-06-18 20:40 ` Helge Deller [this message]
2010-06-19 22:21 ` Helge Deller
2010-06-19 22:57 ` James Bottomley
2010-06-19 23:21 ` John David Anglin
2010-06-20 13:55 ` James Bottomley
2010-06-20 14:35 ` John David Anglin
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=4C1BD9B9.200@gmx.de \
--to=deller@gmx.de \
--cc=James.Bottomley@HansenPartnership.com \
--cc=linux-parisc@vger.kernel.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.