From ac2197dce3e88d7338613afa2f7f53483125d627 Mon Sep 17 00:00:00 2001 From: wessels <> Date: Tue, 21 Apr 1998 08:20:07 +0000 Subject: [PATCH] in storeMaintainSwapSpace, move locked objects from the tail to the head of the LRU list. --- src/store.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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++; -- 2.47.3