Skip to content
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

Merged
merged 10 commits into from
Dec 14, 2020

Conversation

tabokie
Copy link
Member

@tabokie tabokie commented Dec 8, 2020

Signed-off-by: tabokie [email protected]

Add new setter API to RateLimiter, only implement it for WriteAmpBasedRateLimiter.

Signed-off-by: tabokie <[email protected]>
Signed-off-by: tabokie <[email protected]>
Copy link
Collaborator

@yiwu-arbug yiwu-arbug left a 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) {
Copy link
Collaborator

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_?

Copy link
Member Author

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.

Copy link
Collaborator

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.

Copy link
Collaborator

@yiwu-arbug yiwu-arbug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tabokie
Copy link
Member Author

tabokie commented Dec 10, 2020

pin @Connor1996

Signed-off-by: tabokie <[email protected]>
@tabokie tabokie merged commit 4b0908b into tikv:6.4.tikv Dec 14, 2020
@tabokie tabokie deleted the off-tuned branch December 23, 2020 03:17
@tabokie tabokie mentioned this pull request May 9, 2022
39 tasks
tabokie added a commit to tabokie/rocksdb that referenced this pull request May 10, 2022
…kv#217)

Add new APIs to `RateLimiter`, only implement it for `WriteAmpBasedRateLimiter`.
Signed-off-by: tabokie <[email protected]>
tabokie added a commit that referenced this pull request May 11, 2022
Add new APIs to `RateLimiter`, only implement it for `WriteAmpBasedRateLimiter`.
Signed-off-by: tabokie <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants