Re: optimize __gp location

From: Christian Hildner <>
Date: 2005-01-24 18:51:17
Chen, Kenneth W schrieb:

>__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,
Wouldn't a solution using movl for the offset and then add to gp be the 
cheaper solution in terms of cycles? I am wondering that there is an 
additional and expensive load needed with the item possibly (likely or 
not) being not in the cache. But there are the software conventions and 
"nobody will ever need more than" 4MB of short data.

>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.
Did you have benchmarks? Or at least a comparison of the resulting code 
size. The code size should shrink when more items can be addressed 
directly. Furthermore the code size should be a good indicator for the 
performance gain you could achive.


To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to
More majordomo info at
Received on Mon Jan 24 02:52:50 2005

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:35 EST