liburing icon indicating copy to clipboard operation
liburing copied to clipboard

`SQPOLL` can't be used in conjunction with `COOP_TASKRUN`

Open ZhenbangYou opened this issue 1 year ago • 4 comments

I found when I used both flags in io_uring_queue_init, it would fail. However, I didn't find related info in the man page of either io_uring_queue_init or io_uring_setup. Is this an undocumented restriction?

ZhenbangYou avatar Feb 29 '24 01:02 ZhenbangYou

My environment:

  1. Kernel version: 6.1.21.2-microsoft-standard-WSL2+
  2. liburing version: 2.6, latest commit

ZhenbangYou avatar Feb 29 '24 01:02 ZhenbangYou

Also, SQPOLL, SINGLE_ISSUER, and DEFER_TASKRUN can't beused together, but the latter two can be used together. There's also no documentations about this.

ZhenbangYou avatar Feb 29 '24 01:02 ZhenbangYou

SQPOLL doesnt make sense with DEFER_TASKRUN/COOP_TASKRUN or SINGLE_ISSUER as the issuer ends up being the kernel poll thread.

you are correct that there seems to be no documentation though :)

DylanZA avatar Feb 29 '24 09:02 DylanZA

Thanks! These restrictions make sense to me. I think the current man page about SINGLE_ISSUER is a little confusing:

Note that when IORING_SETUP_SQPOLL is set it is considered that the polling task is doing all submissions on behalf of the userspace and so it always complies with the rule disregarding how many userspace tasks do io_uring_enter(2).

It says SQPOLL complies with SINGLE_ISSUER, but doesn't say if they are allowed to be used together (in reality they are). When I was trying these flags, I thought "now that SINGLE_ISSUER is allowed with SQPOLL, why not try DEFER_TASKRUN so that it may improve my performance". Also, COOP_TASKRUN can be used without SINGLE_ISSUER no matter SQPOLL is set or not, which also led to my confusion when they three couldn't be used together.

ZhenbangYou avatar Feb 29 '24 16:02 ZhenbangYou