cur_cpu_spec is a pointer

Anton Blanchard anton at
Mon Apr 12 17:35:08 EST 2004


We are using cur_cpu_spec a lot these days. While working on HW
profiling support I noticed a fair amount of time in some
cur_cpu_spec->cpu_features == X code.

        .tc cur_cpu_spec[TC],cur_cpu_spec

        ld 11,.LC15 at toc(2)
        ld 9,0(11)
        ld 0,16(9)
        rldicl. 9,0,31,63
        bne 0,.L75

Changing it to a struct and not a pointer to a struct saves us one dependent

        ld 9,.LC15 at toc(2)
        ld 0,16(9)
        rldicl. 9,0,31,63
        bne 0,.L75

This also applies to naca and systemcfg. I guess it was done to make
early boot a bit easier (set the naca pointer to point to the early load
location, then relocate it when we switch into virtual mode). Even so,
these structures are pretty heavily used and there could be a measurable
gain in fixing them.

A question for Alan, why cant we put variables directly in the TOC? I
admit it will become a right pain once you get multiple TOCs.


** Sent via the linuxppc64-dev mail list. See

More information about the Linuxppc64-dev mailing list