Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
slash
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
slash
Commits
bf1e9e71
Unverified
Commit
bf1e9e71
authored
Sep 29, 2023
by
Nils Goroll
2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hunt bug #25
parent
155110e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
fellow_cache.c
src/fellow_cache.c
+32
-0
No files found.
src/fellow_cache.c
View file @
bf1e9e71
...
...
@@ -43,6 +43,8 @@
#include "foreign/vend.h"
#define BUG25_CHECK(fcs) assert(VTAILQ_NEXT(fcs, lru_list) != fcs)
#ifdef TEST_DRIVER
#define FCERR_INJECT
#endif
...
...
@@ -1139,9 +1141,20 @@ 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);
...
...
@@ -1203,13 +1216,17 @@ 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--;
...
...
@@ -3056,7 +3073,9 @@ 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);
}
...
...
@@ -3167,6 +3186,9 @@ fellow_cache_lru_work(struct worker *wrk, struct fellow_cache_lru *lru)
AZ(pthread_mutex_lock(&lru->lru_mtx));
//lint -e{850} loop variable modified in body
VTAILQ_FOREACH_SAFE(fcs, &lru->lru_head, lru_list, fcss) {
BUG25_CHECK(fcs);
if (fcss)
BUG25_CHECK(fcss);
// no use trying the same object again and again
if (fcs->fco == fco)
continue;
...
...
@@ -3180,6 +3202,9 @@ 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));
...
...
@@ -3210,6 +3235,8 @@ 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);
...
...
@@ -3232,7 +3259,9 @@ 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));
...
...
@@ -3454,8 +3483,11 @@ fellow_cache_obj_lru_touch(struct fellow_cache_obj *fco)
assert(r == EBUSY);
return (0);
}
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));
...
...
Nils Goroll
@slink
mentioned in commit
f4e7e7ea
·
Sep 30, 2023
mentioned in commit
f4e7e7ea
mentioned in commit f4e7e7ea521ddc753124c31ab6b8fddb5a5da7f9
Toggle commit list
Nils Goroll
@slink
mentioned in commit
dcca7f0b
·
Sep 30, 2023
mentioned in commit
dcca7f0b
mentioned in commit dcca7f0bc0f8b092a979f92e93fc50dca13e7658
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment