summaryrefslogtreecommitdiff
path: root/items.c
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2017-06-22 17:48:41 -0700
committerdormando <dormando@rydia.net>2017-06-22 17:48:41 -0700
commit5a26aca5ecce67234a4277a7e7caf8aa26cc7fd3 (patch)
tree84af705ab410d8f8d715889946a2832a122933d0 /items.c
parent41fa179e90ae75a0c455199f5852d537920e0b30 (diff)
downloadmemcached-5a26aca5ecce67234a4277a7e7caf8aa26cc7fd3.tar.gz
fix LRU maintainer thread slowdown in edge case
if doing a lot of bumps within WARM LRU, the thread can start to sleep more often because it thinks it's not completing any work.
Diffstat (limited to 'items.c')
-rw-r--r--items.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/items.c b/items.c
index b21bf46..8cbb5d4 100644
--- a/items.c
+++ b/items.c
@@ -1091,6 +1091,7 @@ static int lru_pull_tail(const int orig_id, const int cur_lru,
/* Rescue ACTIVE items aggressively */
if ((search->it_flags & ITEM_ACTIVE) != 0) {
search->it_flags &= ~ITEM_ACTIVE;
+ removed++;
if (cur_lru == WARM_LRU) {
itemstats[id].moves_within_lru++;
do_item_update_nolock(search);
@@ -1102,7 +1103,6 @@ static int lru_pull_tail(const int orig_id, const int cur_lru,
move_to_lru = WARM_LRU;
do_item_unlink_q(search);
it = search;
- removed++;
}
} else if (sizes_bytes[id] > limit ||
current_time - search->time > max_age) {