• Yonghong Song's avatar
    fix runqlen.py with 4.15 kernel · ffa47e67
    Yonghong Song authored
    The following kernel commit changes linux_src:kernel/sched/sched.h
    struct cfs_rq structure:
    
    ```
    commit 1ea6c46a23f1213d1972bfae220db5c165e27bba
    Author: Peter Zijlstra <peterz@infradead.org>
    Date:   Sat May 6 15:59:54 2017 +0200
    
        sched/fair: Propagate an effective runnable_load_avg
    
        The load balancer uses runnable_load_avg as load indicator. For
        !cgroup this is:
    
          runnable_load_avg = \Sum se->avg.load_avg ; where se->on_rq
    
        That is, a direct sum of all runnable tasks on that runqueue. As
        opposed to load_avg, which is a sum of all tasks on the runqueue,
        which includes a blocked component.
    ...
    ```
    
    The commit is in kernel 4.15 release and will make current
    runqlen.py internal cfs_rq_partial structure not syncing with the kernel one.
    As a result, runqlen.py will produce incorrect results on 4.15.
    
    This patch attempts to solve this issue by compiling a bpf program,
    which accesses one of fields introduced by the above commit.
    The successful compilation will indicate that we should amend
    the cfs_rq_partial structure.
    Signed-off-by: default avatarYonghong Song <yhs@fb.com>
    ffa47e67
runqlen.py 7.54 KB