From: David Howells <dhowells@redhat.com>
To: Andrew Morton <akpm@osdl.org>
Cc: David Howells <dhowells@redhat.com>,
torvalds@osdl.org, bernds_cb1@t-online.de, sam@ravnborg.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/6] FRV: Fix FRV arch compile errors [try #3]
Date: Thu, 06 Jul 2006 19:25:03 +0100 [thread overview]
Message-ID: <25855.1152210303@warthog.cambridge.redhat.com> (raw)
In-Reply-To: <20060706103134.197c8679.akpm@osdl.org>
Andrew Morton <akpm@osdl.org> wrote:
> - The __init-style tags on declarations don't actually do anything and
> the compiler doesn't check for consistency with the definition - it's
> best to just omit it from the declaration.
Well, you're wrong. They *do* do something. They stop the compiler using the
register-relative addressing reserved for small data. If this isn't in there,
then the linker will spit out a relocation error.
On fixed-size instruction architectures, it takes several instructions to
dereference an absolute address, so you try and squeeze all your small data
into a section of its own, plonk a register in the middle of it, and use
indirect-addressing relative to that register. This saves you two or more
instructions and a register on each normal global variable access.
For instance, on FRV, it may change:
sethi.p %hi(nr_kernel_pages),gr4
setlo %lo(nr_kernel_pages),gr4
ld @(gr4,gr0),gr5
Into:
ld @(gr16,%gprel(nr_kernel_pages)),gr5
Small data is 1-byte, 2-byte, 4-byte or 8-byte values that aren't arrays or
const.
Setting a section marker on the variable *declaration* disables the
gp-relative addressing and forces the longer absolute addressing.
> - Setting nr_kernel_pages to be unloaded at free_initmem() seems risky.
That's nothing to do with my patch.
> - nr_kernel_pages is actually __meminitdata.
Okay, I'll fix my patch to be that instead.
David
next prev parent reply other threads:[~2006-07-06 18:25 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-06 12:47 [PATCH 0/6] Fix FRV, ELF-FDPIC and NOMMU stuff [try #3] David Howells
2006-07-06 12:47 ` [PATCH 1/6] FDPIC: Fix FDPIC compile errors " David Howells
2006-07-06 13:40 ` David Woodhouse
2006-07-07 9:41 ` David Howells
2006-07-06 12:47 ` [PATCH 2/6] FRV: Fix FRV arch " David Howells
2006-07-06 17:31 ` Andrew Morton
2006-07-06 18:25 ` David Howells [this message]
2006-07-06 18:39 ` Andrew Morton
2006-07-06 19:02 ` David Howells
2006-07-06 17:36 ` Andrew Morton
2006-07-06 18:29 ` David Howells
2006-07-06 12:47 ` [PATCH 3/6] NOMMU: Fix execution off of ramfs with mmap() " David Howells
2006-07-06 12:47 ` [PATCH 4/6] FDPIC: Adjust the ELF-FDPIC driver to conform more to the CodingStyle " David Howells
2006-07-06 12:47 ` [PATCH 5/6] FDPIC: Add coredump capability for the ELF-FDPIC binfmt " David Howells
2006-07-06 17:52 ` Andrew Morton
2006-07-06 18:38 ` David Howells
2006-07-06 23:27 ` Andrew Morton
2006-07-07 9:46 ` David Howells
2006-07-07 10:54 ` David Howells
2006-07-07 11:00 ` David Howells
2006-07-07 11:12 ` Andrew Morton
2006-07-07 9:54 ` David Howells
2006-07-07 10:20 ` Andrew Morton
2006-07-07 10:34 ` David Howells
2006-07-06 12:47 ` [PATCH 6/6] FRV: Introduce asm-offsets for FRV arch " David Howells
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=25855.1152210303@warthog.cambridge.redhat.com \
--to=dhowells@redhat.com \
--cc=akpm@osdl.org \
--cc=bernds_cb1@t-online.de \
--cc=linux-kernel@vger.kernel.org \
--cc=sam@ravnborg.org \
--cc=torvalds@osdl.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox