Skip to content
Snippets Groups Projects
  • Tom Lane's avatar
    5cfa8dd3
    Use mutex hint bit in PPC LWARX instructions, where possible. · 5cfa8dd3
    Tom Lane authored
    The hint bit makes for a small but measurable performance improvement
    in access to contended spinlocks.
    
    On the other hand, some PPC chips give an illegal-instruction failure.
    There doesn't seem to be a completely bulletproof way to tell whether the
    hint bit will cause an illegal-instruction failure other than by trying
    it; but most if not all 64-bit PPC machines should accept it, so follow
    the Linux kernel's lead and assume it's okay to use it in 64-bit builds.
    Of course we must also check whether the assembler accepts the command,
    since even with a recent CPU the toolchain could be old.
    
    Patch by Manabu Ori, significantly modified by me.
    5cfa8dd3
    History
    Use mutex hint bit in PPC LWARX instructions, where possible.
    Tom Lane authored
    The hint bit makes for a small but measurable performance improvement
    in access to contended spinlocks.
    
    On the other hand, some PPC chips give an illegal-instruction failure.
    There doesn't seem to be a completely bulletproof way to tell whether the
    hint bit will cause an illegal-instruction failure other than by trying
    it; but most if not all 64-bit PPC machines should accept it, so follow
    the Linux kernel's lead and assume it's okay to use it in 64-bit builds.
    Of course we must also check whether the assembler accepts the command,
    since even with a recent CPU the toolchain could be old.
    
    Patch by Manabu Ori, significantly modified by me.