HomeClusterLabs Projects

Filesystem: get_pids() "safe": scan /proc only once
6733541f30cbUnpublished

Unpublished Commit ยท Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

Filesystem: get_pids() "safe": scan /proc only once

Caution: advanced shell trickery.

With many processes, scanning /proc can take significant time.
Use only one find /proc, feed /proc/**/maps to grep via fifo and xargs,
and send matching symlinks to stdout directly.

On a "busy" system, this cuts the time for get_pids() almost in half.

Details

Provenance
Lars Ellenberg <lars.ellenberg@linbit.com>Authored on Sep 19 2024, 5:40 AM
Parents
rRb748ccb4589e: Merge pull request #1975 from oalbrigt/docker-compose-v2
Branches
Unknown
Tags
Unknown

Event Timeline