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
d75053a1
Unverified
Commit
d75053a1
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
f53aec90
Changes
1
Hide 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 @
d75053a1
...
@@ -2966,7 +2966,17 @@ fellow_cache_lru_work(struct worker *wrk, struct fellow_cache_lru *lru)
...
@@ -2966,7 +2966,17 @@ fellow_cache_lru_work(struct worker *wrk, struct fellow_cache_lru *lru)
struct
buddy_ptr_extent
alloc
;
struct
buddy_ptr_extent
alloc
;
int
r
;
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
);
CHECK_OBJ_NOTNULL
(
lru
,
FELLOW_CACHE_LRU_MAGIC
);
buddy
=
lru
->
fc
->
membuddy
;
buddy
=
lru
->
fc
->
membuddy
;
...
@@ -2990,6 +3000,7 @@ fellow_cache_lru_work(struct worker *wrk, struct fellow_cache_lru *lru)
...
@@ -2990,6 +3000,7 @@ fellow_cache_lru_work(struct worker *wrk, struct fellow_cache_lru *lru)
fellow_cache_lru_seg_evict_locked
(
fcs
,
fellow_cache_lru_seg_evict_locked
(
fcs
,
&
alloc
,
lru
);
&
alloc
,
lru
);
AZ
(
pthread_mutex_unlock
(
&
fco
->
mtx
));
AZ
(
pthread_mutex_unlock
(
&
fco
->
mtx
));
AZ
(
pthread_mutex_unlock
(
&
lru
->
lru_mtx
));
fco
=
NULL
;
fco
=
NULL
;
break
;
break
;
}
}
...
@@ -3002,6 +3013,7 @@ fellow_cache_lru_work(struct worker *wrk, struct fellow_cache_lru *lru)
...
@@ -3002,6 +3013,7 @@ fellow_cache_lru_work(struct worker *wrk, struct fellow_cache_lru *lru)
/* mutate was successful
/* mutate was successful
* VSC_C_main->n_lru_nuked++; // XXX per lru ?
* VSC_C_main->n_lru_nuked++; // XXX per lru ?
*/
*/
AZ
(
pthread_mutex_unlock
(
&
lru
->
lru_mtx
));
break
;
break
;
}
}
oc
=
NULL
;
oc
=
NULL
;
...
@@ -3011,9 +3023,9 @@ fellow_cache_lru_work(struct worker *wrk, struct fellow_cache_lru *lru)
...
@@ -3011,9 +3023,9 @@ fellow_cache_lru_work(struct worker *wrk, struct fellow_cache_lru *lru)
AZ
(
pthread_mutex_unlock
(
&
fco
->
mtx
));
AZ
(
pthread_mutex_unlock
(
&
fco
->
mtx
));
WRONG
(
"fcs state in lru"
);
WRONG
(
"fcs state in lru"
);
}
}
AZ
(
pthread_mutex_unlock
(
&
lru
->
lru_mtx
));
if
(
fcs
==
NULL
)
{
if
(
fcs
==
NULL
)
{
AZ
(
pthread_mutex_unlock
(
&
lru
->
lru_mtx
));
// VSLb(wrk->vsl, SLT_ExpKill, "LRU_Fail");
// VSLb(wrk->vsl, SLT_ExpKill, "LRU_Fail");
AZ
(
alloc
.
ptr
);
AZ
(
alloc
.
ptr
);
AZ
(
oc
);
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