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

Resolve cgroup inode in fanotify as soon as possible #265

Merged
merged 1 commit into from
Sep 13, 2023

Commits on Sep 13, 2023

  1. Resolve cgroup inode in fanotify as soon as possible

    In cloudflare#264 we reduced
    the amount of syscalls, here we reorder them to get the inode first.
    
    Before:
    
    ```
    ivan@vm:~$ sudo strace -f -TT -e open_by_handle_at,newfstatat,readlinkat -p $(pidof ebpf_exporter)
    strace: Process 14153 attached with 11 threads
    [pid 14153] open_by_handle_at(7, {handle_bytes=8, handle_type=254, f_handle="\x36\x00\x00\x00\x00\x00\x00\x00"}, O_RDONLY) = 13 <0.000764>
    [pid 14153] readlinkat(AT_FDCWD, "/proc/self/fd/13", "/sys/fs/cgroup/system.slice", 128) = 27 <0.000815>
    [pid 14153] newfstatat(AT_FDCWD, "/sys/fs/cgroup/system.slice/systemd-resolved.service", {st_mode=S_IFDIR|0755, st_size=0, ...}, 0) = 0 <0.000839>
    ```
    
    After:
    
    ```
    ivan@vm:~$ sudo strace -f -TT -e open_by_handle_at,newfstatat,readlinkat -p $(pidof ebpf_exporter)
    strace: Process 13925 attached with 10 threads
    [pid 13931] open_by_handle_at(7, {handle_bytes=8, handle_type=254, f_handle="\x36\x00\x00\x00\x00\x00\x00\x00"}, O_RDONLY) = 13 <0.000700>
    [pid 13931] newfstatat(13, "systemd-resolved.service", {st_mode=S_IFDIR|0755, st_size=0, ...}, 0) = 0 <0.001069>
    [pid 13931] readlinkat(AT_FDCWD, "/proc/self/fd/13", "/sys/fs/cgroup/system.slice", 128) = 27 <0.000774>
    ```
    bobrik committed Sep 13, 2023
    Configuration menu
    Copy the full SHA
    1cdace4 View commit details
    Browse the repository at this point in the history