If hit in COLD, immediately move to WARM
Ignores the wait period.
@@ -443,27 +443,33 @@ void do_item_update_nolock(item *it) {
/* Bump the last accessed time, or relink if we're in compat mode */
void do_item_update(item *it) {
MEMCACHED_ITEM_UPDATE(ITEM_key(it), it->nkey, it->nbytes);
- if (it->time < current_time - ITEM_UPDATE_INTERVAL) {
- assert((it->it_flags & ITEM_SLABBED) == 0);
+ /* Hits to COLD_LRU immediately move to WARM. */
+ if (settings.lru_maintainer_thread) {
+ assert((it->it_flags & ITEM_SLABBED) == 0);
if ((it->it_flags & ITEM_LINKED) != 0) {
- it->time = current_time;
// FIXME: do better LRU check.
- if (settings.lru_maintainer_thread) {
if (it->slabs_clsid >= COLD_LRU && it->slabs_clsid < NOEXP_LRU) {
+ it->time = current_time;
item_unlink_q(it);
it->slabs_clsid = ITEM_clsid(it);
it->slabs_clsid |= WARM_LRU;
it->it_flags &= ~ITEM_ACTIVE;
item_link_q_warm(it);
+ } else if (it->time < current_time - ITEM_UPDATE_INTERVAL) {
+ it->time = current_time;
}
- } else {
+ }
+ } else if (it->time < current_time - ITEM_UPDATE_INTERVAL) {
+ assert((it->it_flags & ITEM_SLABBED) == 0);
+
+ if ((it->it_flags & ITEM_LINKED) != 0) {
+ it->time = current_time;
item_unlink_q(it);
item_link_q(it);
}
}
}
-}
int do_item_replace(item *it, item *new_it, const uint32_t hv) {
MEMCACHED_ITEM_REPLACE(ITEM_key(it), it->nkey, it->nbytes,
