public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* optimize __gp location
@ 2005-01-21 23:22 Chen, Kenneth W
  2005-01-22  1:02 ` Keith Owens
                   ` (14 more replies)
  0 siblings, 15 replies; 17+ messages in thread
From: Chen, Kenneth W @ 2005-01-21 23:22 UTC (permalink / raw)
  To: linux-ia64

__gp is positioned so far out that it is almost at the end of all data
sections.  On 2.6.11-rc1, 80% of kernel data symbols are out of 22-bit
immediate offset from __gp.  This means accessing these symbols are 
unnecessarily expansive such that they have to go through global offset
table (a memory load to get the symbol address).  Among these out of
reach symbols from __gp, some are very frequently used, like Jiffies,
etc.

Can we position the __gp somewhat more optimally, to cover more of these
symbols? Something like the following patch would make all of them fall
into the 22-bit immediate offset relative to gp.

--- linux-2.6.11-rc1/arch/ia64/kernel/vmlinux.lds.S.orig
2005-01-21 11:43:57.000000000 -0800
+++ linux-2.6.11-rc1/arch/ia64/kernel/vmlinux.lds.S	2005-01-21
14:45:29.000000000 -0800
@@ -193,7 +193,7 @@ SECTIONS
   . = ALIGN(16);	/* gp must be 16-byte aligned for exc. table */
   .got : AT(ADDR(.got) - LOAD_OFFSET)
 	{ *(.got.plt) *(.got) }
-  __gp = ADDR(.got) + 0x200000;
+  __gp = _end - 0x200000;
   /* We want the small data sections together, so single-instruction
offsets
      can access them all, and initialized data all before
uninitialized, so
      we can shorten the on-disk segment size.  */
@@ -205,7 +205,7 @@ SECTIONS
 	{ *(.sbss) *(.scommon) }
   .bss : AT(ADDR(.bss) - LOAD_OFFSET)
 	{ *(.bss) *(COMMON) }
-
+  . = ALIGN(16);
   _end = .;
 
   code : { } :code

Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2005-01-25 20:01 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-21 23:22 optimize __gp location Chen, Kenneth W
2005-01-22  1:02 ` Keith Owens
2005-01-22  1:02 ` Luck, Tony
2005-01-22  2:20 ` Chen, Kenneth W
2005-01-22  3:09 ` Keith Owens
2005-01-24  7:51 ` Christian Hildner
2005-01-24 13:22 ` Keith Owens
2005-01-24 13:29   ` Matthew Wilcox
2005-01-24 13:44 ` Christian Hildner
2005-01-24 15:32 ` Keith Owens
2005-01-24 17:51 ` David Mosberger
2005-01-24 17:53 ` David Mosberger
2005-01-25  7:30 ` Christian Hildner
2005-01-25 19:44 ` Chen, Kenneth W
2005-01-25 19:51 ` David Mosberger
2005-01-25 19:57 ` Chen, Kenneth W
2005-01-25 20:01 ` David Mosberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox