Repository navigation
Conversation
Author
|
Upstream branch: de52810 |
The nvmet issues namespace IOs from kernel threads. So the io.max and other cgroup controllers can't apply limits to the namespaces. Consider this scenario: LVM creates multiple logical volumes on the same physical disk, and the logical volumes are assigned to different nvmet subsystems/namespaces. We want to stop a remote noisy user from using all the disk iops via nvmet. So add a per namespace cgroup_id to associate the namespace with a cgroup. Each namespace can then be throttled separately. The per namespace cgroup is good enough for the io.max, but is not good enough for the io.cost and io.latency. The io.cost and io.latency may put a thread to sleep. If the thread is shared by different namespaces, all of them will be impacted together. Submit the IOs via a workqueue to avoid this impact. With cgroup_id set, every I/O command except Reservation commands runs from its own work item on a per namespace WQ_HIGHPRI workqueue. Zone management and the file backend's Flush, DSM and Write Zeroes run directly in that work item. Each work item runs under memalloc_noio and looks up the cgroup's effective io css. A command whose queue is being deleted is aborted. buffered_io is not supported. Performance test: On a 4 core VM and 4G ramdisk, export tcp-nvmeof targets to 127.0.0.1, run fio with below parameters: fio --bs=4k --rw=randwrite --iodepth=32 --numjobs=4 --ioengine=libaio --direct=1 file backend result: | | IOPS | Mean Latency | p99 latency | |without this patch | 204.4k | 625.8 µs | 668 µs | |this patch, cgroup_id unset | 204.4k | 625.7 µs | 668 µs | |this patch, cgroup_id set | 155.9k | 820.6 µs | 1139 µs | block device backend result: | | IOPS | Mean Latency | p99 latency | |without this patch | 216.0k | 592.2 µs | 627 µs | |this patch, cgroup_id unset | 216.0k | 592.1 µs | 627 µs | |this patch, cgroup_id set | 160.0k | 799.6 µs | 1090 µs | With this patch and no cgroup_id set, the performance is almost the same. When we set the cgroup_id, with no io controller limit, we can see a performance decrease but it is still very fast. Signed-off-by: Peng Yu <yupeng0921@gmail.com> Acked-by: Tejun Heo <tj@kernel.org> Assisted-by: Claude:claude-fable-5 [Claude Code] Assisted-by: Claude:claude-opus-5-5 [Claude Code]
Author
|
Upstream branch: de52810 |
ghost
force-pushed
the
series/1174579=>for-next
branch
from
November 10, 2026 10:28
b7e3a87 to
066668e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request for series with
subject: nvmet: add cgroup_id to charge namespace I/O to a cgroup
version: 13
url: https://patchwork.kernel.org/series/1204350/