Skip to content

Commit

Permalink
Process high pri request with mutex in rate limiter
Browse files Browse the repository at this point in the history
Signed-off-by: Yang Zhang <yang.zhang@pingcap.com>
  • Loading branch information
v01dstar committed Sep 23, 2024
1 parent ca2cf28 commit 4b56a99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utilities/rate_limiters/write_amp_based_rate_limiter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ void WriteAmpBasedRateLimiter::Request(int64_t bytes, const Env::IOPriority pri,
TEST_SYNC_POINT("WriteAmpBasedRateLimiter::Request");
TEST_SYNC_POINT_CALLBACK("WriteAmpBasedRateLimiter::Request:1",
&rate_bytes_per_sec_);
MutexLock g(&request_mutex_);
if (auto_tuned_.load(std::memory_order_acquire) &&
(pri == Env::IO_HIGH || pri == Env::IO_USER) &&
duration_highpri_bytes_through_ + duration_bytes_through_ + bytes <=
Expand All @@ -154,7 +155,6 @@ void WriteAmpBasedRateLimiter::Request(int64_t bytes, const Env::IOPriority pri,
return;
}
assert(bytes <= refill_bytes_per_period_.load(std::memory_order_relaxed));
MutexLock g(&request_mutex_);

if (auto_tuned_.load(std::memory_order_acquire)) {
std::chrono::microseconds now(NowMicrosMonotonic(env_));
Expand Down

0 comments on commit 4b56a99

Please sign in to comment.