Skip to content

blk/kernel: make KernelDevice::aio_stop atomic - #72460

Open
Doracly wants to merge 1 commit into
ceph:mainfrom
Doracly:TSan-noise-removal
Open

Doracly wants to merge 1 commit into
ceph:mainfrom
Doracly:TSan-noise-removal

Conversation

@Doracly

@Doracly Doracly commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Fixes a data race that ThreadSanitizer reports in 4 unit tests (51 reports, now 0). The other fixes moved to #73712, #73713 and #73714.

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@Doracly

Doracly commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

@rzarzynski Could you take a look, or point me to the right reviewer? These are ThreadSanitizer data race fixes in log, msg, common and blk.

@Doracly

Doracly commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

These are independent, small ThreadSanitizer data race fixes. Could you each review the commits in your area?

@aainscow: 85d0c66 (log), 40f7807 (test/osd EventLoop)
@ifed01: 99bf3e0 (blk/kernel)
@dvanders: a5ef9df (msg/async)
@tchaikov: 6963314 (admin_socket), d386318 (ceph_context), 49b47d9 (mempool), d8c7696 (signal_handler)

@ifed01

ifed01 commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

These are independent, small ThreadSanitizer data race fixes. Could you each review the commits in your area?

@aainscow: 85d0c66 (log), 40f7807 (test/osd EventLoop) @ifed01: 99bf3e0 (blk/kernel) @dvanders: a5ef9df (msg/async) @tchaikov: 6963314 (admin_socket), d386318 (ceph_context), 49b47d9 (mempool), d8c7696 (signal_handler)

blk/kenrel piece looks good to me. But honestly I'd prefer having individual fixing PR per module/subsystem. Approvals collection would have a clearer path then. E.g. I'm not sure how to approve this whole PR given I've reviewed kernel part only...

_aio_stop() sets aio_stop while the aio thread polls it:

    WARNING: ThreadSanitizer: data race
      Write of size 1 by main thread:
        #0 KernelDevice::_aio_stop() src/blk/kernel/KernelDevice.cc:587
        ceph#1 KernelDevice::close() src/blk/kernel/KernelDevice.cc:377
      Previous read of size 1 by thread T3:
        #0 KernelDevice::_aio_thread() src/blk/kernel/KernelDevice.cc:694
      Thread T3 'bstore_aio' created by main thread

Relaxed ordering is enough: aio_stop guards no other data, and
_aio_stop() joins the thread after waking it with a read.

Assisted-by: claude-opus-5-5
Signed-off-by: Dominik Raddatz <[email protected]>
@Doracly Doracly changed the title common,log,msg,blk: fix data races reported by ThreadSanitizer blk/kernel: make KernelDevice::aio_stop atomic Nov 10, 2026
@Doracly

Doracly commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

@ifed01 split as you suggested: this PR now has only the blk/kernel commit.

@Doracly
Doracly removed request for a team, aainscow, dvanders and tchaikov November 10, 2026 08:50
@Doracly

Doracly commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

The other commits moved to #73712 (common, global; @tchaikov) and #73714 (log, test/osd; @aainscow). @dvanders: msg/async is now #73713 with idryomov as reviewer, so nothing is left for you here.

@Doracly

Doracly commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

@ifed01 thanks for the review! Could you add needs-qa?

@ifed01

ifed01 commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

@ifed01 thanks for the review! Could you add needs-qa?

done

@SrinivasaBharath

Copy link
Copy Markdown
Contributor

This PR has been added to wip-bharath1-testing-20261114.051618-main.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants