Skip to content

pidwait: replace busy-loop with pidfd_open and poll on Linux#711

Open
Krysztal112233 wants to merge 1 commit into
uutils:mainfrom
Krysztal112233:feat/refactor-pidwait
Open

pidwait: replace busy-loop with pidfd_open and poll on Linux#711
Krysztal112233 wants to merge 1 commit into
uutils:mainfrom
Krysztal112233:feat/refactor-pidwait

Conversation

@Krysztal112233
Copy link
Copy Markdown
Collaborator

@Krysztal112233 Krysztal112233 commented May 29, 2026

This PR pick the Linux implementation from PR #400 to replace the inefficient busy-loop polling (/proc every 50ms) with pidfd_open + poll, which blocks efficiently in the kernel with zero CPU usage.

Also added a simple test to verify the wait works correctly.

Thanks for @FurryR

@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2026

Codecov Report

❌ Patch coverage is 0% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 19.19%. Comparing base (a995b90) to head (8df52cb).
⚠️ Report is 19 commits behind head on main.

Files with missing lines Patch % Lines
src/uu/pidwait/src/wait.rs 0.00% 24 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #711      +/-   ##
==========================================
- Coverage   19.21%   19.19%   -0.02%     
==========================================
  Files          68       68              
  Lines       10150    10158       +8     
  Branches      546      546              
==========================================
  Hits         1950     1950              
- Misses       8200     8208       +8     
Flag Coverage Δ
macos_latest 6.74% <ø> (ø)
ubuntu_latest 19.55% <0.00%> (-0.02%) ⬇️
windows_latest 0.02% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@FurryR
Copy link
Copy Markdown

FurryR commented May 30, 2026

Nice to see the new implementation here. Ima like dropping my pull request
Will see if I can help.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants