rate_limiter: add RateLimiterGroup

Add a 'rate_limiter/group' module that defines the RateLimiterGroup
and a RateLimiterGroupHandle types.

The RateLimiterGroupHandle can be used in place of a RateLimiter to
limit the aggregate bandwidth and/or ops of multiple virtio-blk or
virtio-net queues.

Each RateLimiterGroup has an associated worker thread that broadcasts
an event to each RateLimiterGroupHandle when a RateLimiter is unblocked.

Signed-off-by: Thomas Barrett <tbarrett@crusoeenergy.com>
This commit is contained in:
Thomas Barrett
2023-12-13 21:13:10 +00:00
committed by Bo Chen
parent d11480197e
commit c71da496c0
4 changed files with 533 additions and 0 deletions

2
Cargo.lock generated
View File

@@ -1780,8 +1780,10 @@ checksum = "8edc89eaa583cf6bc4c6ef16a219f0a60d342ca3bf0eae793560038ac8af1795"
name = "rate_limiter"
version = "0.1.0"
dependencies = [
"epoll",
"libc",
"log",
"thiserror",
"vmm-sys-util",
]