Skip to content

DAOS-19956 bio: fix deadlock of concurrent bio_copy_prep() - #19638

Open
liuxuezhao wants to merge 2 commits into
release/2.6from
lxz/bio_deadlock_fix_26
Open

liuxuezhao wants to merge 2 commits into
release/2.6from
lxz/bio_deadlock_fix_26

Conversation

@liuxuezhao

Copy link
Copy Markdown
Contributor

bio_copy_prep() held the DMA buffer of the source while waiting for other active IODs to get the buffer of the destination. VOS aggregation runs such copies concurrently, one per container: when their sources hold all the DMA chunks and the buffer cannot grow, they wait for each other forever and block all later I/O of the xstream which needs a DMA buffer.

A copy must not yield while it holds only one of its two buffers: prepare the destination first, which doesn't load anything, then the source without waiting nor yielding in between. If the source can't get its buffer, release the destination buffer, wait for an active IOD to complete and start over.

Add VOS439, with all the DMA chunks held but the ones for the copies: a copy with one free chunk waits without holding it and completes once there are two; three copies with two free chunks all complete. The fail_loc DAOS_NVME_COPY_YIELD simulates the time to load the source, to interleave the copies as in a server.

Steps for the author:

  • Commit message follows the guidelines.
  • Appropriate Features or Test-tag pragmas were used.
  • Appropriate Functional Test Stages were run.
  • At least two positive code reviews including at least one code owner from each category referenced in the PR.
  • Testing is complete. If necessary, forced-landing label added and a reason added in a comment.

After all prior steps are complete:

  • Gatekeeper requested (daos-gatekeeper added as a reviewer).

bio_copy_prep() held the DMA buffer of the source while waiting
for other active IODs to get the buffer of the destination. VOS
aggregation runs such copies concurrently, one per container: when
their sources hold all the DMA chunks and the buffer cannot grow,
they wait for each other forever and block all later I/O of the
xstream which needs a DMA buffer.

A copy must not yield while it holds only one of its two buffers:
prepare the destination first, which doesn't load anything, then
the source without waiting nor yielding in between. If the source
can't get its buffer, release the destination buffer, wait for an
active IOD to complete and start over.

Add VOS439, with all the DMA chunks held but the ones for the
copies: a copy with one free chunk waits without holding it and
completes once there are two; three copies with two free chunks
all complete. The fail_loc DAOS_NVME_COPY_YIELD simulates the time
to load the source, to interleave the copies as in a server.

Signed-off-by: Xuezhao Liu <xuezhao.liu@hpe.com>
@liuxuezhao
liuxuezhao requested review from a team as code owners November 25, 2026 06:46
@github-actions

Copy link
Copy Markdown

Ticket title is 'Aurora daos_user: Rebuild is getting stuck when excluded the rank to fix the bad DRAM memory'
Status is 'In Progress'
Labels: 'ALCF,request_for_2.6.6,request_for_2.8.2'
https://daosio.atlassian.net/browse/DAOS-19956

The only caller checks bdb_active_iods > 0 just before the call
and nothing yields in between, so the check for no active IOD in
copy_wait_iods() can never be true. Replace it with an assertion,
the wait relies on an active IOD to be woken up.

Signed-off-by: Xuezhao Liu <xuezhao.liu@hpe.com>

This branch has not been deployed

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants