Skip to content

Count RAM usage of pipe generated by pipe() and fcntl(F_GETPIPE_SZ) #308

Open

Description

@oech3

context: uutils/coreutils#11597

uutils/coreutils uses
https://github.com/uutils/coreutils/blob/0366d3c657ef02ff7c82dcd25926e0485db38ed2/src/uucore/src/lib/features/pipes.rs#L24-L31 to generate 1 MiB pipe used only from the process. However, CodSpeed does not count it as RAM usage since pipe is allocated by Linux kernel itself (not malloc).
I want to count them as RAM usage.

I know it is very rare usecase. But I think something like codspeed_ram_usage!(1024 * 1024); is more generic.

Activity

  1. GuillaumeLagrange commented on Apr 21, 2026

    @GuillaumeLagrange
    Contributor

    Hello, indeed that would be interesting to track. We have a few improvements to the memory instrument planned. We'll see if there's a generic way to retrieve this memory allocation through sys call monitoring, else we may just add a declarative way for users to signal ram usage that we fail to detect automatically, although I'd like to avoid this.

  2. oech3 commented on Apr 21, 2026

    @oech3
    Author

    fcntl returns pipe size (which might larger than requested size).
    In my thought, this is same with requesting to count size of files on /tmp if /tmp is tmpfs.

  3. oech3 commented on Apr 22, 2026

    @oech3
    Author

    Same issue for memfd_create?

  4. oech3 commented on Jun 6, 2026

    @oech3
    Author

    In context of zero-copy, pipe size is not an actuall RAM usage, but I think we can detect it as page cash's generated by splice call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions