Skip to content

crimson/os/seastore: wake blocked IO on BackgroundProcess wakeup - #69275

Merged
Matan-B merged 1 commit into
ceph:mainfrom
fultheim:seastore-io-wakeup
Jun 17, 2026
Merged

Matan-B merged 1 commit into
ceph:mainfrom
fultheim:seastore-io-wakeup

Conversation

@fultheim

@fultheim fultheim commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes a latent deadlock window in ExtentPlacementManager::BackgroundProcess::run(): when background_should_run() is false but the space-availability condition (should_block_io) has just become satisfied, the wake-up loop returns to sleep without re-checking blocked IO. The blocked IO stays stuck until some unrelated future wake-up happens to coincide, or never.

The fix is a single maybe_wake_blocked_io() call right after the wake, before the loop re-checks background_should_run(). It's a no-op when nothing is blocked.

Why it matters

Observed in sustained random-write benches where IO stalled indefinitely while the cleaner sat idle. The bug only fires in a narrow race (cleaner work just ended at the same moment IO unblock was due) but the failure mode is permanent IO block — no further trigger ever re-checks.

Test plan

  • Build clean against current main
  • No-op on workloads where nothing is blocked
  • Targeted reproducer of the race (not included — the race is hard to trigger deterministically; happy to add a stress test if reviewers prefer)

Contribution Guidelines

  • Tracker (select at least one)
    • Very recent bug; references commit where it was introduced — discovered during sustained-write benches against current main
    • References tracker ticket
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • No impact that needs to be tracked
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
  • Documentation (select at least one)
    • No doc update is appropriate
    • Updates relevant documentation
  • Tests (select at least one)
    • No tests
    • Includes unit test(s)
    • Includes integration test(s)
    • Includes bug reproducer

Copilot AI review requested due to automatic review settings June 3, 2026 20:54
@fultheim
fultheim requested a review from a team as a code owner June 3, 2026 20:54
@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

16 similar comments
@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Ensures blocked user I/O can be re-evaluated after the background process wakes from a blocking sleep, preventing scenarios where user I/O remains blocked without another trigger.

Changes:

  • Invoke maybe_wake_blocked_io() immediately after waking from blocking_background.
  • Add explanatory comment describing the “blocked IO stuck” scenario and rationale.

@Matan-B
Matan-B self-requested a review June 4, 2026 11:09
@Matan-B Matan-B added this to Crimson Jun 4, 2026
@Matan-B Matan-B moved this to Awaits review in Crimson Jun 4, 2026
BackgroundProcess::run() blocks on blocking_background when
background_should_run() returns false. When the loop wakes up —
typically because arm_blocking_io_and_wake() kicked it — the loop
re-checks background_should_run(). If that still returns false
(e.g. the cleaner has no pending work), the loop goes straight back
to sleep.

But the wake may also have been triggered by a change in the space-
availability condition (should_block_io) — and there is no path that
re-evaluates blocked user IO when background_should_run is false. The
blocked IO has no future trigger to re-check, and stays stuck until
the next unrelated wake-up happens to come at the right moment, or
never.

Add a maybe_wake_blocked_io() call right after the wake. It's a no-op
when nothing is blocked, and unblocks IO that the space condition has
already cleared otherwise.

Observed in sustained random-write benches that wedged with IO blocked
indefinitely while the cleaner sat idle (should_run=false).

Signed-off-by: Shai Fultheim <[email protected]>
@fultheim
fultheim force-pushed the seastore-io-wakeup branch from 0b6986c to 8f3a166 Compare June 9, 2026 11:18
@fultheim

fultheim commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Rebased on the latest upstream main branch to align with recent community commits and resolved minor comment style warnings. No functional logic changes were made in this rebase.

@Matan-B Matan-B moved this from Awaits review to Needs QA in Crimson Jun 11, 2026
@perezjosibm

Copy link
Copy Markdown
Contributor
  • Shaman build (in progress): wip-perezjos-crimson-only-11-06-2026-PR69275

@Matan-B

Matan-B commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Thank you! From the failures the only seastore failed ones are https://tracker.ceph.com/issues/77402 which are not related, merging.

@Matan-B Matan-B moved this from Needs QA to Tested in Crimson Jun 15, 2026
@Matan-B

Matan-B commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

ok to test

@ronen-fr

Copy link
Copy Markdown
Contributor

jenkins test make check

@ronen-fr

Copy link
Copy Markdown
Contributor

jenkins test make check arm64

@ronen-fr

Copy link
Copy Markdown
Contributor

@Matan-B

Matan-B commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

jenkins test make check arm64

@Matan-B
Matan-B merged commit c6741c1 into ceph:main Jun 17, 2026
6 checks passed
@Matan-B Matan-B moved this from Tested to Merged (Main) in Crimson Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Merged (Main)

Development

Successfully merging this pull request may close these issues.

6 participants