Revert "Hunt bug #25"

See next commit for fix

This reverts commit bf1e9e71.
parent 2d468a6f
...@@ -43,8 +43,6 @@ ...@@ -43,8 +43,6 @@
#include "foreign/vend.h" #include "foreign/vend.h"
#define BUG25_CHECK(fcs) assert(VTAILQ_NEXT(fcs, lru_list) != fcs)
#ifdef TEST_DRIVER #ifdef TEST_DRIVER
#define FCERR_INJECT #define FCERR_INJECT
#endif #endif
...@@ -1141,20 +1139,9 @@ fellow_cache_lru_chgbatch_apply(struct fellow_lru_chgbatch *lcb) ...@@ -1141,20 +1139,9 @@ fellow_cache_lru_chgbatch_apply(struct fellow_lru_chgbatch *lcb)
TAKE_OBJ_NOTNULL(fcs, &lcb->fcs[lcb->n_rem], TAKE_OBJ_NOTNULL(fcs, &lcb->fcs[lcb->n_rem],
FELLOW_CACHE_SEG_MAGIC); FELLOW_CACHE_SEG_MAGIC);
assert(fcs->fco == fco); assert(fcs->fco == fco);
BUG25_CHECK(fcs);
VTAILQ_REMOVE(&lru->lru_head, fcs, lru_list); 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); 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)); AZ(pthread_mutex_unlock(&lru->lru_mtx));
lcb->n_add = 0; lcb->n_add = 0;
AZ(lcb->n_rem); AZ(lcb->n_rem);
...@@ -1217,17 +1204,13 @@ fellow_cache_lru_chg(struct fellow_lru_chgbatch *lcb, ...@@ -1217,17 +1204,13 @@ fellow_cache_lru_chg(struct fellow_lru_chgbatch *lcb,
AZ(fcs->lcb_add); AZ(fcs->lcb_add);
AZ(fcs->lcb_remove); AZ(fcs->lcb_remove);
fcs->lcb_add = 1; fcs->lcb_add = 1;
BUG25_CHECK(fcs);
VTAILQ_INSERT_TAIL(&lcb->add, fcs, lru_list); VTAILQ_INSERT_TAIL(&lcb->add, fcs, lru_list);
BUG25_CHECK(fcs);
lcb->n_add++; lcb->n_add++;
} }
else if (fcs->lcb_add) { else if (fcs->lcb_add) {
//DBG("%p -add", fcs); //DBG("%p -add", fcs);
AZ(fcs->lcb_remove); AZ(fcs->lcb_remove);
BUG25_CHECK(fcs);
VTAILQ_REMOVE(&lcb->add, fcs, lru_list); VTAILQ_REMOVE(&lcb->add, fcs, lru_list);
BUG25_CHECK(fcs);
fcs->lcb_add = 0; fcs->lcb_add = 0;
AN(lcb->n_add); AN(lcb->n_add);
lcb->n_add--; lcb->n_add--;
...@@ -3074,9 +3057,7 @@ fellow_cache_lru_seg_evict_locked( ...@@ -3074,9 +3057,7 @@ fellow_cache_lru_seg_evict_locked(
fcs->fcs_onlru = 0; fcs->fcs_onlru = 0;
AN(lru->n); AN(lru->n);
lru->n--; lru->n--;
BUG25_CHECK(fcs);
VTAILQ_REMOVE(&lru->lru_head, fcs, lru_list); VTAILQ_REMOVE(&lru->lru_head, fcs, lru_list);
BUG25_CHECK(fcs);
fellow_cache_seg_evict_locked(fcs, alloc); fellow_cache_seg_evict_locked(fcs, alloc);
} }
...@@ -3188,9 +3169,6 @@ fellow_cache_lru_work(struct worker *wrk, struct fellow_cache_lru *lru) ...@@ -3188,9 +3169,6 @@ fellow_cache_lru_work(struct worker *wrk, struct fellow_cache_lru *lru)
//lint -e{850} loop variable modified in body //lint -e{850} loop variable modified in body
VTAILQ_FOREACH_SAFE(fcs, &lru->lru_head, lru_list, fcss) { VTAILQ_FOREACH_SAFE(fcs, &lru->lru_head, lru_list, fcss) {
assert(fcs != fcss); assert(fcs != fcss);
BUG25_CHECK(fcs);
if (fcss)
BUG25_CHECK(fcss);
// no use trying the same object again and again // no use trying the same object again and again
if (fcs->fco == fco) if (fcs->fco == fco)
continue; continue;
...@@ -3204,9 +3182,6 @@ fellow_cache_lru_work(struct worker *wrk, struct fellow_cache_lru *lru) ...@@ -3204,9 +3182,6 @@ fellow_cache_lru_work(struct worker *wrk, struct fellow_cache_lru *lru)
} }
if (fcs->state == FCS_INCORE) { if (fcs->state == FCS_INCORE) {
do { do {
BUG25_CHECK(fcs);
if (fcss)
BUG25_CHECK(fcss);
fellow_cache_lru_seg_evict_locked(fcs, fellow_cache_lru_seg_evict_locked(fcs,
&alloc, lru); &alloc, lru);
AN(buddy_return_ptr_extent(rets, &alloc)); AN(buddy_return_ptr_extent(rets, &alloc));
...@@ -3237,8 +3212,6 @@ fellow_cache_lru_work(struct worker *wrk, struct fellow_cache_lru *lru) ...@@ -3237,8 +3212,6 @@ fellow_cache_lru_work(struct worker *wrk, struct fellow_cache_lru *lru)
AN(lru->n); AN(lru->n);
lru->n--; lru->n--;
VTAILQ_REMOVE(&lru->lru_head, fcs, lru_list); VTAILQ_REMOVE(&lru->lru_head, fcs, lru_list);
BUG25_CHECK(fcs);
AZ(pthread_mutex_unlock(&lru->lru_mtx)); AZ(pthread_mutex_unlock(&lru->lru_mtx));
r = stvfe_mutate(wrk, lru, oc); r = stvfe_mutate(wrk, lru, oc);
...@@ -3261,9 +3234,7 @@ fellow_cache_lru_work(struct worker *wrk, struct fellow_cache_lru *lru) ...@@ -3261,9 +3234,7 @@ fellow_cache_lru_work(struct worker *wrk, struct fellow_cache_lru *lru)
AN(fcs->fco_lru_mutate); AN(fcs->fco_lru_mutate);
fcs->fco_lru_mutate = 0; fcs->fco_lru_mutate = 0;
BUG25_CHECK(fcs);
VTAILQ_INSERT_TAIL(&lru->lru_head, fcs, lru_list); VTAILQ_INSERT_TAIL(&lru->lru_head, fcs, lru_list);
BUG25_CHECK(fcs);
lru->n++; lru->n++;
AZ(pthread_mutex_unlock(&fco->mtx)); AZ(pthread_mutex_unlock(&fco->mtx));
...@@ -3486,11 +3457,8 @@ fellow_cache_obj_lru_touch(struct fellow_cache_obj *fco) ...@@ -3486,11 +3457,8 @@ fellow_cache_obj_lru_touch(struct fellow_cache_obj *fco)
return (0); return (0);
} }
AZ(fcs->fco_lru_mutate); AZ(fcs->fco_lru_mutate);
BUG25_CHECK(fcs);
VTAILQ_REMOVE(&lru->lru_head, fcs, lru_list); VTAILQ_REMOVE(&lru->lru_head, fcs, lru_list);
BUG25_CHECK(fcs);
VTAILQ_INSERT_TAIL(&lru->lru_head, fcs, lru_list); VTAILQ_INSERT_TAIL(&lru->lru_head, fcs, lru_list);
BUG25_CHECK(fcs);
//lint -e{455} flexelint does not grok trylock //lint -e{455} flexelint does not grok trylock
AZ(pthread_mutex_unlock(&lru->lru_mtx)); 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