Skip to content

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

Merged
Krysztal112233 merged 2 commits into
uutils:mainfrom
Krysztal112233:feat/refactor-pidwait
Jun 5, 2026
Merged

pidwait: replace busy-loop with pidfd_open and poll on Linux#711
Krysztal112233 merged 2 commits into
uutils:mainfrom
Krysztal112233:feat/refactor-pidwait

Conversation

@Krysztal112233

@Krysztal112233Krysztal112233 commented May 29, 2026

Copy link
Copy Markdown
Collaborator

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

codecovBot commented May 29, 2026

Copy link
Copy Markdown

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 (ebd7d9b).
⚠️ Report is 21 commits behind head on main.

Files with missing linesPatch %Lines
src/uu/pidwait/src/wait.rs0.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 
FlagCoverage Δ
macos_latest6.74% <ø> (ø)
ubuntu_latest19.55% <0.00%> (-0.02%)⬇️
windows_latest0.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

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

@Krysztal112233
Krysztal112233 merged commit 097d304 into uutils:mainJun 5, 2026
16 of 18 checks passed
Sign up for freeto 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.

3 participants

@Krysztal112233@FurryR@Bluemangoo