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
2160d040
Unverified
Commit
2160d040
authored
Sep 28, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use buddy_returns in memory LRU
parent
1e1a2ed8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
15 deletions
+12
-15
fellow_cache.c
src/fellow_cache.c
+12
-15
No files found.
src/fellow_cache.c
View file @
2160d040
...
...
@@ -3104,7 +3104,6 @@ fellow_cache_obj_slim(const struct fellow_cache *fc,
static
int
fellow_cache_lru_work
(
struct
worker
*
wrk
,
struct
fellow_cache_lru
*
lru
)
{
buddy_t
*
buddy
;
struct
fellow_cache_seg
*
fcs
,
*
fcss
;
struct
fellow_cache_obj
*
fco
;
struct
objcore
*
oc
;
...
...
@@ -3127,7 +3126,9 @@ fellow_cache_lru_work(struct worker *wrk, struct fellow_cache_lru *lru)
*/
CHECK_OBJ_NOTNULL
(
lru
,
FELLOW_CACHE_LRU_MAGIC
);
buddy
=
lru
->
fc
->
membuddy
;
struct
buddy_returns
*
rets
=
BUDDY_RETURNS_STK
(
lru
->
fc
->
membuddy
,
BUDDY_RETURNS_MAX
);
alloc
=
buddy_ptr_extent_nil
;
oc
=
NULL
;
...
...
@@ -3149,6 +3150,7 @@ fellow_cache_lru_work(struct worker *wrk, struct fellow_cache_lru *lru)
&
alloc
,
lru
);
AZ
(
pthread_mutex_unlock
(
&
fco
->
mtx
));
AZ
(
pthread_mutex_unlock
(
&
lru
->
lru_mtx
));
AN
(
buddy_return_ptr_extent
(
rets
,
&
alloc
));
fco
=
NULL
;
break
;
}
...
...
@@ -3203,30 +3205,25 @@ fellow_cache_lru_work(struct worker *wrk, struct fellow_cache_lru *lru)
* so for fcs == NULL, we know we have iterated over
* all of the LRU
*/
if
(
fcs
==
NULL
)
{
if
(
fcs
==
NULL
)
AZ
(
pthread_mutex_unlock
(
&
lru
->
lru_mtx
));
// VSLb(wrk->vsl, SLT_ExpKill, "LRU_Fail");
AZ
(
alloc
.
ptr
);
AZ
(
alloc
.
ptr
);
buddy_return
(
rets
);
if
(
fcs
==
NULL
)
{
AZ
(
oc
);
return
(
0
);
}
/*
* at this point, we know we terminated the foreach
* with a break
, so we either have an alloc return, or an FCO
* with a break
. If we have an fco, we need to deref it.
*/
if
(
alloc
.
ptr
!=
NULL
)
{
AZ
(
fco
);
AN
(
alloc
.
size
);
buddy_return1_ptr_extent
(
buddy
,
&
alloc
);
}
else
if
(
fco
!=
NULL
)
{
if
(
fco
!=
NULL
)
{
AN
(
oc
);
// VSLb(wrk->vsl, SLT_ExpKill, "LRU x=%u", ObjGetXID(wrk, oc));
// we removed the oc's reference on fco in stvfe_mutate()
fellow_cache_obj_deref
(
lru
->
fc
,
fco
);
}
else
{
INCOMPL
();
}
return
(
1
);
}
...
...
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