[PATCH -next] blk-throttle: enable io throttle for root in cgroup v2

From: Ofir Gal
Date: Sun Feb 05 2023 - 10:56:24 EST


From: Ofir Gal <ofir@gal.software>

Hello Ming Lei,

I am trying to use cgroups v2 to throttle a media disk that is controlled by an NVME target.
Unfortunately, it cannot be done without setting the limit in the root cgroup.
It can be done via cgroups v1. Yu Kuai's patch allows this to be accomplished.

My setup consist from 3 servers.
Server #1:
a. SSD media disk (needs to be throttled to 100K IOPs)
b. NVME target controlling the SSD (1.a)

Server #2:
a. NVME initiator is connected to Server #1 NVME target (1.b)

Server #3:
a. NVME initiator is connected to Server #1 NVME target (1.b)

My setup accesses this media from multiple servers using NVMe over TCP,
but the initiator servers' workloads are unknown and can be changed dynamically. I need to limit the media disk to 100K IOPS on the target side.

I have tried to limit the SSD on Server #1, but it seems that the NVME target kworkers are not affected unless I use Yu Kuai's patch.

Can you elaborate on the issues with this patch or how the scenario described above can be done with cgroups v2?

Best regards, Ofir Gal.