From: wessels <> Date: Tue, 21 Apr 1998 08:20:07 +0000 (+0000) Subject: in storeMaintainSwapSpace, move locked objects from the X-Git-Tag: SQUID_3_0_PRE1~3482 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac2197dce3e88d7338613afa2f7f53483125d627;p=thirdparty%2Fsquid.git in storeMaintainSwapSpace, move locked objects from the tail to the head of the LRU list. --- diff --git a/src/store.cc b/src/store.cc index eda7e78f73..b3c7858dbb 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,6 +1,6 @@ /* - * $Id: store.cc,v 1.406 1998/04/20 23:26:17 wessels Exp $ + * $Id: store.cc,v 1.407 1998/04/21 02:20:07 wessels Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -672,6 +672,17 @@ storeMaintainSwapSpace(void *datanotused) prev = m->prev; e = m->data; if (storeEntryLocked(e)) { + /* + * If there is a locked entry at the tail of the LRU list, + * move it to the beginning to get it out of the way. + * Theoretically, we might have all locked objects at the + * tail, and then we'll never remove anything here and the + * LRU age will go to zero. + */ + if (memInUse(MEM_STOREENTRY) > max_scan) { + dlinkDelete(&e->lru, &store_list); + dlinkAdd(e, &e->lru, &store_list); + } locked++; } else if (storeCheckExpired(e, 1)) { expired++;