Revert "Hunt bug #25"

See next commit for fix

This reverts commit bf1e9e71.

Conflicts:
	src/fellow_cache.c
parent bd781051
......@@ -41,8 +41,6 @@
#include "fellow_cache_storage.h"
#include "fellow_tune.h"
#define BUG25_CHECK(fcs) assert(VTAILQ_NEXT(fcs, lru_list) != fcs)
#ifdef TEST_DRIVER
#define FCERR_INJECT
#endif
......@@ -1120,20 +1118,9 @@ fellow_cache_lru_chgbatch_apply(struct fellow_lru_chgbatch *lcb)
TAKE_OBJ_NOTNULL(fcs, &lcb->fcs[lcb->n_rem],
FELLOW_CACHE_SEG_MAGIC);
assert(fcs->fco == fco);
BUG25_CHECK(fcs);
VTAILQ_REMOVE(&lru->lru_head, fcs, lru_list);
}
fcs = VTAILQ_FIRST(&lcb->add);
if (fcs)
BUG25_CHECK(fcs);
fcs = VTAILQ_FIRST(&lru->lru_head);
if (fcs)
BUG25_CHECK(fcs);
VTAILQ_CONCAT(&lru->lru_head, &lcb->add, lru_list);
fcs = VTAILQ_FIRST(&lru->lru_head);
if (fcs)
BUG25_CHECK(fcs);
AZ(pthread_mutex_unlock(&lru->lru_mtx));
lcb->n_add = 0;
AZ(lcb->n_rem);
......@@ -1196,17 +1183,13 @@ fellow_cache_lru_chg(struct fellow_lru_chgbatch *lcb,
AZ(fcs->lcb_add);
AZ(fcs->lcb_remove);
fcs->lcb_add = 1;
BUG25_CHECK(fcs);
VTAILQ_INSERT_TAIL(&lcb->add, fcs, lru_list);
BUG25_CHECK(fcs);
lcb->n_add++;
}
else if (fcs->lcb_add) {
//DBG("%p -add", fcs);
AZ(fcs->lcb_remove);
BUG25_CHECK(fcs);
VTAILQ_REMOVE(&lcb->add, fcs, lru_list);
BUG25_CHECK(fcs);
fcs->lcb_add = 0;
AN(lcb->n_add);
lcb->n_add--;
......@@ -3052,9 +3035,7 @@ fellow_cache_lru_seg_evict_locked(
fcs->fcs_onlru = 0;
AN(lru->n);
lru->n--;
BUG25_CHECK(fcs);
VTAILQ_REMOVE(&lru->lru_head, fcs, lru_list);
BUG25_CHECK(fcs);
fellow_cache_seg_evict_locked(fcs, alloc);
}
......@@ -3166,9 +3147,6 @@ fellow_cache_lru_work(struct worker *wrk, struct fellow_cache_lru *lru)
//lint -e{850} loop variable modified in body
VTAILQ_FOREACH_SAFE(fcs, &lru->lru_head, lru_list, fcss) {
assert(fcs != fcss);
BUG25_CHECK(fcs);
if (fcss)
BUG25_CHECK(fcss);
// no use trying the same object again and again
if (fcs->fco == fco)
continue;
......@@ -3182,9 +3160,6 @@ fellow_cache_lru_work(struct worker *wrk, struct fellow_cache_lru *lru)
}
if (fcs->state == FCS_INCORE) {
do {
BUG25_CHECK(fcs);
if (fcss)
BUG25_CHECK(fcss);
fellow_cache_lru_seg_evict_locked(fcs,
&alloc, lru);
AN(buddy_return_ptr_extent(rets, &alloc));
......@@ -3215,8 +3190,6 @@ fellow_cache_lru_work(struct worker *wrk, struct fellow_cache_lru *lru)
AN(lru->n);
lru->n--;
VTAILQ_REMOVE(&lru->lru_head, fcs, lru_list);
BUG25_CHECK(fcs);
AZ(pthread_mutex_unlock(&lru->lru_mtx));
r = stvfe_mutate(wrk, lru, oc);
......@@ -3239,9 +3212,7 @@ fellow_cache_lru_work(struct worker *wrk, struct fellow_cache_lru *lru)
AN(fcs->fco_lru_mutate);
fcs->fco_lru_mutate = 0;
BUG25_CHECK(fcs);
VTAILQ_INSERT_TAIL(&lru->lru_head, fcs, lru_list);
BUG25_CHECK(fcs);
lru->n++;
AZ(pthread_mutex_unlock(&fco->mtx));
......@@ -3464,11 +3435,8 @@ fellow_cache_obj_lru_touch(struct fellow_cache_obj *fco)
return (0);
}
AZ(fcs->fco_lru_mutate);
BUG25_CHECK(fcs);
VTAILQ_REMOVE(&lru->lru_head, fcs, lru_list);
BUG25_CHECK(fcs);
VTAILQ_INSERT_TAIL(&lru->lru_head, fcs, lru_list);
BUG25_CHECK(fcs);
//lint -e{455} flexelint does not grok trylock
AZ(pthread_mutex_unlock(&lru->lru_mtx));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment