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
cbff1609
Unverified
Commit
cbff1609
authored
Aug 02, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New locking paradigm for fellow_cache_lru_work
parent
565503af
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
fellow_cache.c
src/fellow_cache.c
+14
-2
No files found.
src/fellow_cache.c
View file @
cbff1609
...
...
@@ -2988,7 +2988,17 @@ fellow_cache_lru_work(struct worker *wrk, struct fellow_cache_lru *lru)
struct
buddy_ptr_extent
alloc
;
int
r
;
//lint --e{456} flexelint does not grok trylock
/*lint --e{454,455,456}
*
* flexelint does not understand the locking structure here:
*
* - it dies not understand trylock
* - we leave the loop either with break
* - mtx unlocked
* - fcs != NULL
* - or foreach finishes, then fcs == NULL and the mtx
* needs to be unlocked
*/
CHECK_OBJ_NOTNULL
(
lru
,
FELLOW_CACHE_LRU_MAGIC
);
buddy
=
lru
->
fc
->
membuddy
;
...
...
@@ -3012,6 +3022,7 @@ fellow_cache_lru_work(struct worker *wrk, struct fellow_cache_lru *lru)
fellow_cache_lru_seg_evict_locked
(
fcs
,
&
alloc
,
lru
);
AZ
(
pthread_mutex_unlock
(
&
fco
->
mtx
));
AZ
(
pthread_mutex_unlock
(
&
lru
->
lru_mtx
));
fco
=
NULL
;
break
;
}
...
...
@@ -3024,6 +3035,7 @@ fellow_cache_lru_work(struct worker *wrk, struct fellow_cache_lru *lru)
/* mutate was successful
* VSC_C_main->n_lru_nuked++; // XXX per lru ?
*/
AZ
(
pthread_mutex_unlock
(
&
lru
->
lru_mtx
));
break
;
}
oc
=
NULL
;
...
...
@@ -3033,9 +3045,9 @@ fellow_cache_lru_work(struct worker *wrk, struct fellow_cache_lru *lru)
AZ
(
pthread_mutex_unlock
(
&
fco
->
mtx
));
WRONG
(
"fcs state in lru"
);
}
AZ
(
pthread_mutex_unlock
(
&
lru
->
lru_mtx
));
if
(
fcs
==
NULL
)
{
AZ
(
pthread_mutex_unlock
(
&
lru
->
lru_mtx
));
// VSLb(wrk->vsl, SLT_ExpKill, "LRU_Fail");
AZ
(
alloc
.
ptr
);
AZ
(
oc
);
...
...
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