Skip to content

fix io_uring max submissions being capped to 0 #1958

Open
catfinated wants to merge 5 commits intoNVIDIA:mainfrom
catfinated:pull_request/1949
Open

fix io_uring max submissions being capped to 0 #1958
catfinated wants to merge 5 commits intoNVIDIA:mainfrom
catfinated:pull_request/1949

Conversation

@catfinated
Copy link

@catfinated catfinated commented Mar 24, 2026

This addresses #1949.

With this change, the io_uring context submission queue max submissions no longer gets capped to 0 which allows work to actually be submitted to the kernel. In particular, the bug this is addressing was causing the run_until_stopped() method to break out of the main loop immediately causing both the example code and unit test to hang indefinitely at blocking sync_wait calls.

This also resolves an issue in the io_uring related unit tests where calls to start_detached were ambiguous. This was necessary to compile with io_uring support enabled as well as to validate the fix since the unit test also encountered the hanging issue.

@copy-pr-bot
Copy link

copy-pr-bot bot commented Mar 24, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@ericniebler
Copy link
Collaborator

how funny. i spotted that __umin bug this morning and just fixed it. are the other changes still necessary? CI is green.

@catfinated
Copy link
Author

catfinated commented Mar 24, 2026

That is funny. I did post an issue report a few days ago that included a fix. I am particularly interested in the io_uring support so it was the first thing I tried to run and ran into that bug.

As far as the other changes I believe they are needed but its possibly compiler dependent (or I am possibly missing some detail as I just started looking at the codebase). I am on gcc 15.2.1 and clang 22.1.1 and without those changes to the unit test I get an ambiguous function call error:

[78/141] Building CXX object test/exec/CMakeFiles/test.exec.dir/test_io_uring_context.cpp.o
FAILED: [code=1] test/exec/CMakeFiles/test.exec.dir/test_io_uring_context.cpp.o 
/usr/bin/c++ -DSTDEXEC_NAMESPACE=std::execution -I/ssd1/projects/oss/stdexec/include -I/ssd1/projects/oss/stdexec/build/include -I/ssd1/projects/oss/stdexec/build/_deps/catch2-src/single_include -I/ssd1/projects/oss/stdexec/test -O3 -DNDEBUG -std=gnu++20 -fcoroutines -fconcepts-diagnostics-depth=10 -Wall -Werror=unused-parameter -Wno-non-template-friend -MD -MT test/exec/CMakeFiles/test.exec.dir/test_io_uring_context.cpp.o -MF test/exec/CMakeFiles/test.exec.dir/test_io_uring_context.cpp.o.d -o test/exec/CMakeFiles/test.exec.dir/test_io_uring_context.cpp.o -c /ssd1/projects/oss/stdexec/test/exec/test_io_uring_context.cpp
/ssd1/projects/oss/stdexec/test/exec/test_io_uring_context.cpp: In function ‘void {anonymous}::____C_A_T_C_H____T_E_S_T____6()’:
/ssd1/projects/oss/stdexec/test/exec/test_io_uring_context.cpp:122:5: error: reference to ‘start_detached’ is ambiguous
  122 |     start_detached(schedule(scheduler)
      |     ^~~~~~~~~~~~~~
In file included from /ssd1/projects/oss/stdexec/include/exec/finally.hpp:18,
                 from /ssd1/projects/oss/stdexec/test/exec/test_io_uring_context.cpp:24:
/ssd1/projects/oss/stdexec/include/exec/../stdexec/__detail/__execution_fwd.hpp:323:33: note: candidates are: ‘const experimental::execution::start_detached_t experimental::execution::start_detached’
  323 |   extern start_detached_t const start_detached;
      |                                 ^~~~~~~~~~~~~~
In file included from /ssd1/projects/oss/stdexec/include/exec/linux/../../stdexec/execution.hpp:82,
                 from /ssd1/projects/oss/stdexec/include/exec/linux/io_uring_context.hpp:26,
                 from /ssd1/projects/oss/stdexec/test/exec/test_io_uring_context.cpp:25:
/ssd1/projects/oss/stdexec/include/exec/linux/../../stdexec/__detail/__deprecations.hpp:78:51: note:                 ‘constexpr const experimental::execution::start_detached_t& std::execution::start_detached’
   78 |   inline constexpr exec::start_detached_t const & start_detached = exec::start_detached;
      |                                                   ^~~~~~~~~~~~~~
/ssd1/projects/oss/stdexec/test/exec/test_io_uring_context.cpp: In function ‘void {anonymous}::____C_A_T_C_H____T_E_S_T____16()’:
/ssd1/projects/oss/stdexec/test/exec/test_io_uring_context.cpp:209:7: error: reference to ‘start_detached’ is ambiguous
  209 |       start_detached(schedule(scheduler)
      |       ^~~~~~~~~~~~~~
/ssd1/projects/oss/stdexec/include/exec/../stdexec/__detail/__execution_fwd.hpp:323:33: note: candidates are: ‘const experimental::execution::start_detached_t experimental::execution::start_detached’
  323 |   extern start_detached_t const start_detached;
      |                                 ^~~~~~~~~~~~~~
/ssd1/projects/oss/stdexec/include/exec/linux/../../stdexec/__detail/__deprecations.hpp:78:51: note:                 ‘constexpr const experimental::execution::start_detached_t& std::execution::start_detached’
   78 |   inline constexpr exec::start_detached_t const & start_detached = exec::start_detached;
      |                                                   ^~~~~~~~~~~~~~
[95/141] Building CXX object test/exec/CMakeFiles/test.exec.dir/test_split.cpp.o
ninja: build stopped: subcommand failed.

inline constexpr auto __umin(std::initializer_list<std::size_t> __il) noexcept -> std::size_t
{
std::size_t __m = std::numeric_limits<std::size_t>::max();
std::size_t __m = ~0UL;
Copy link
Author

Choose a reason for hiding this comment

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

[nit] #include <limits> is no longer need with this initializer

@ericniebler
Copy link
Collaborator

could you pls run clang-format-21 over test_io_uring_context.cpp?

@catfinated
Copy link
Author

catfinated commented Mar 24, 2026

@ericniebler Thanks, not sure why my clang-format did the wrong thing. Should I change the PR title to align with the fact that this now just addresses the unit test function call ambiguity issue instead of the __umin bug?

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