• Jason Baron's avatar
    jump label: Reduce the cycle count by changing the link order · b77f0f3c
    Jason Baron authored
    In the course of testing jump labels for use with the CFS
    bandwidth controller, Paul Turner, discovered that using jump
    labels reduced the branch count and the instruction count, but
    did not reduce the cycle count or wall time.
    
    I noticed that having the jump_label.o included in the kernel
    but not used in any way still caused this increase in cycle
    count and wall time. Thus, I moved jump_label.o in the
    kernel/Makefile, thus changing the link order, and presumably
    moving it out of hot icache areas. This brought down the cycle
    count/time as expected.
    
    In addition to Paul's testing,  I've tested the patch using a
    single 'static_branch()' in the getppid() path, and basically
    running tight loops of calls to getppid(). Here are my results
    for the branch disabled case:
    
    With jump labels turned on (CONFIG_JUMP_LABEL), branch disabled:
    
     Performance counter stats for 'bash -c /tmp/getppid;true' (50 runs):
    
         3,969,510,217 instructions             #	 ...
    b77f0f3c
Makefile 5.04 KB