-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dynamically set auto_tuned mode of WriteAmpBasedRateLimiter #217
Conversation
Signed-off-by: tabokie <[email protected]>
Signed-off-by: tabokie <[email protected]>
Signed-off-by: tabokie <[email protected]>
Signed-off-by: tabokie <[email protected]>
Signed-off-by: tabokie <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest LGTM
max_bytes_per_sec_.store(bytes_per_second, std::memory_order_relaxed); | ||
} else { | ||
SetActualBytesPerSecond(bytes_per_second); | ||
} | ||
} | ||
|
||
void WriteAmpBasedRateLimiter::SetAutoTuned(bool auto_tuned) { | ||
MutexLock g(&auto_tuned_mutex_); | ||
if (auto_tuned_.load(std::memory_order_relaxed) != auto_tuned) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use seq_cst order for all access to auto_tuned_
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think seq_cst is equivalent to acq_rel if only one variable is tagged. I went through the logic again and added some tags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, using acquire/release ordering is even better, but sometimes they are hard to reason about. But as we are considering use arm, it make more sense for us to take some effort and use the acquire/release semantics if suitable.
Signed-off-by: tabokie <[email protected]>
Signed-off-by: tabokie <[email protected]>
Signed-off-by: tabokie <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
pin @Connor1996 |
Signed-off-by: tabokie <[email protected]>
…kv#217) Add new APIs to `RateLimiter`, only implement it for `WriteAmpBasedRateLimiter`. Signed-off-by: tabokie <[email protected]>
Add new APIs to `RateLimiter`, only implement it for `WriteAmpBasedRateLimiter`. Signed-off-by: tabokie <[email protected]>
Signed-off-by: tabokie [email protected]
Add new setter API to
RateLimiter
, only implement it forWriteAmpBasedRateLimiter
.