Skip to contentSkip to conversation

Are CAP_SYS_ADMIN and CAP_SYS_NICE still needed for SQPOLL?

DISCUSSION Stefano Garzarella 3 participants 4 messages Mar 25, 2021 io_uring

lore
Share & tools
lore
#0 lore raw

Hi Jens, Hi Pavel,
I was taking a look at the new SQPOLL handling with io_thread instead of kthread. Great job! Really nice feature that maybe can be reused also in other scenarios (e.g. vhost).

Regarding SQPOLL, IIUC these new threads are much closer to user threads, so is there still a need to require CAP_SYS_ADMIN and CAP_SYS_NICE to enable SQPOLL?

Thanks,
Stefano

#1 lore raw
Quoted 4 lines · Stefano Garzarella

Hi Jens, Hi Pavel,
I was taking a look at the new SQPOLL handling with io_thread instead of kthread. Great job! Really nice feature that maybe can be reused also in other scenarios (e.g. vhost).

Regarding SQPOLL, IIUC these new threads are much closer to user threads, so is there still a need to require CAP_SYS_ADMIN and CAP_SYS_NICE to enable SQPOLL?

Hmm, good question. If there are under same cgroup (should be in theory), and if we add more scheduling points (i.e. need_resched()), and don't see a reason why not. Jens?

Better not right away though. IMHO it's safer to let the change settle down for some time.

Signature · 1 line
Pavel Begunkov
maintainer
#2 lore raw
Quoted 4 lines · Pavel Begunkov
Quoted 3 lines · Stefano Garzarella

Hi Jens, Hi Pavel,
I was taking a look at the new SQPOLL handling with io_thread instead of kthread. Great job! Really nice feature that maybe can be reused also in other scenarios (e.g. vhost).

Quoted 8 lines
Quoted 1 line

Regarding SQPOLL, IIUC these new threads are much closer to user threads, so is there still a need to require CAP_SYS_ADMIN and CAP_SYS_NICE to enable SQPOLL?

Hmm, good question. If there are under same cgroup (should be in theory), and if we add more scheduling points (i.e. need_resched()), and don't see a reason why not. Jens?

Better not right away though. IMHO it's safer to let the change settle down for some time.

Yes, agree on both counts - we are not going to need elevated privileges going forward, but I'd also rather defer making that change until 5.13 so we have a bit more time on the current (new) base first.

Signature · 1 line
Jens Axboe
#3 lore raw
Quoted 11 lines · Jens Axboe
Quoted 10 lines · Pavel Begunkov
Quoted 4 lines · Stefano Garzarella

Hi Jens, Hi Pavel,
I was taking a look at the new SQPOLL handling with io_thread instead of kthread. Great job! Really nice feature that maybe can be reused also in other scenarios (e.g. vhost).

Regarding SQPOLL, IIUC these new threads are much closer to user threads, so is there still a need to require CAP_SYS_ADMIN and CAP_SYS_NICE to enable SQPOLL?

Hmm, good question. If there are under same cgroup (should be in theory), and if we add more scheduling points (i.e. need_resched()), and don't see a reason why not. Jens?

Quoted 6 lines
Quoted 2 lines

Better not right away though. IMHO it's safer to let the change settle down for some time.

Yes, agree on both counts - we are not going to need elevated privileges going forward, but I'd also rather defer making that change until 5.13 so we have a bit more time on the current (new) base first.

Yeah, that makes sense to me!

Thank you both for the quick clarification,
Stefano