Messages in this thread | | | Date | Thu, 10 Jul 2008 10:26:51 -0500 | From | Christoph Lameter <> | Subject | Re: [RFC 00/15] x86_64: Optimize percpu accesses |
| |
H. Peter Anvin wrote:
> Noone has talked about the actual placement of the percpu segment data.
But the placement of the percpu segment data is a problem because of the way we currently have the linker calculate offsets. I have had kernel configurations where I changed the placement of the percpu segment leading to linker failures because the percpu segment was not in 2G range of the code segment!
This is a particular problem if we have a large number of processors (like 4096) that each require a sizable segment of virtual address space up there for the per cpu allocator.
> None of this affects the absolute positioning of the data. The final > address are determined by: > > fs_base + rip + offset > or > fs_base + offset > > ... respectively. fs_base is an arbitrary 64-bit number; rip (in the > kernel) is in the range [-2 GB + CONFIG_PHYSICAL_START, 0), and offset > is in the range [-2 GB, 2 GB).
Well the zero based results in this becoming always
gs_base + absolute address in per cpu segment
Why are RIP based references cheaper? The offset to the per cpu segment is certainly more than what can be fit into 16 bits.
| |