Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add builtin numaid to get NUMA Node ID #2177

Merged
merged 1 commit into from
Jun 1, 2022
Merged

Commits on May 26, 2022

  1. Add builtin 'numaid'

    Example:
    NUMA node information:
    
        $ numactl --hardware
        available: 2 nodes (0-1)
        node 0 cpus: 0 1 2 3 4 5 6 7 ...
        [...]
        node 1 cpus: 20 21 22 23 24 25 ...
        [...]
        node distances:
        node   0   1
        0:  10  21
        1:  21  10
    
    bpftrace script code net_action.bt:
        kprobe:net_tx_action,
        kprobe:net_rx_action
        {
            @[numaid, comm] = count();
        }
    
    Example1:
        ------------------------------------------------------------
        iperf3 server:
        $ taskset -c 1 iperf3 -s
        [...]
        [  5]   0.00-1.00   sec  6.04 GBytes  51.9 Gbits/sec
        [...]
    
        iperf3 client:
        $ taskset -c 2 iperf3 -c 0
        [...]
        [  5]   0.00-1.00   sec  6.04 GBytes  51.9 Gbits/sec    0   1.19 MBytes
        [...]
    
        net_action.bt output:
        @[0, iperf3]: 2430857
    
        Because both cpu1 and cpu2 are on the numa node 0.
    
    Example2:
        ------------------------------------------------------------
        iperf3 server:
        $ taskset -c 1 iperf3 -s
        [...]
        [  5]   0.00-1.00   sec  2.79 GBytes  24.0 Gbits/sec
        [...]
    
        iperf3 client:
        $ taskset -c 21 iperf3 -c 0
        [...]
        [  5]   0.00-1.00   sec  2.79 GBytes  24.0 Gbits/sec    0   1023 KBytes
        [...]
    
        net_action.bt output:
        @[0, iperf3]: 456193
        @[1, iperf3]: 684853
    
    Because cpu1 on numa node0, cpu21 on numa node1, Processes that
    need to communicate running on different nodes cause poor performance,
    It is very easy to get numa with `numaid`.
    Rtoax committed May 26, 2022
    Configuration menu
    Copy the full SHA
    c4736de View commit details
    Browse the repository at this point in the history