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
1fc5caf7
Unverified
Commit
1fc5caf7
authored
Mar 02, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
noop refactor: fcs eviction with/without lru
parent
d52435a7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
5 deletions
+21
-5
fellow_cache.c
src/fellow_cache.c
+14
-5
fellow_storage.c
src/fellow_storage.c
+7
-0
No files found.
src/fellow_cache.c
View file @
1fc5caf7
...
@@ -2504,18 +2504,27 @@ fellow_cache_async_thread(void *priv)
...
@@ -2504,18 +2504,27 @@ fellow_cache_async_thread(void *priv)
// XXX better way
// XXX better way
#ifndef TEST_DRIVER
#ifndef TEST_DRIVER
static
inline
void
static
inline
void
fellow_cache_seg_evict_locked
(
struct
fellow_cache
*
fc
,
fellow_cache_seg_evict_locked
(
struct
fellow_cache_seg
*
fcs
,
struct
buddy_ptr_extent
*
alloc
)
struct
fellow_cache_seg
*
fcs
,
struct
buddy_ptr_extent
*
alloc
)
{
{
AZ
(
fcs
->
refcnt
);
AZ
(
fcs
->
refcnt
);
A
N
(
fcs
->
fcs_onlru
);
A
Z
(
fcs
->
fcs_onlru
);
assert
(
fcs
->
state
==
FCS_INCORE
);
assert
(
fcs
->
state
==
FCS_INCORE
);
*
alloc
=
fcs
->
alloc
;
*
alloc
=
fcs
->
alloc
;
fcs
->
alloc
=
buddy_ptr_extent_nil
;
fcs
->
alloc
=
buddy_ptr_extent_nil
;
fcs
->
len
=
0
;
fcs
->
len
=
0
;
fcs
->
state
=
FCS_DISK
;
fcs
->
state
=
FCS_DISK
;
}
static
inline
void
fellow_cache_lru_seg_evict_locked
(
struct
fellow_cache_seg
*
fcs
,
struct
buddy_ptr_extent
*
alloc
,
struct
fellow_cache
*
fc
)
{
AN
(
fcs
->
fcs_onlru
);
fcs
->
fcs_onlru
=
0
;
fcs
->
fcs_onlru
=
0
;
VTAILQ_REMOVE
(
&
fc
->
lru_head
,
fcs
,
lru_list
);
VTAILQ_REMOVE
(
&
fc
->
lru_head
,
fcs
,
lru_list
);
fellow_cache_seg_evict_locked
(
fcs
,
alloc
);
}
}
static
int
static
int
...
@@ -2546,8 +2555,8 @@ fellow_cache_lru_work(struct worker *wrk, struct fellow_cache *fc)
...
@@ -2546,8 +2555,8 @@ fellow_cache_lru_work(struct worker *wrk, struct fellow_cache *fc)
continue
;
continue
;
}
}
if
(
fcs
->
state
==
FCS_INCORE
)
{
if
(
fcs
->
state
==
FCS_INCORE
)
{
fellow_cache_
seg_evict_locked
(
fc
,
fcs
,
fellow_cache_
lru_seg_evict_locked
(
fcs
,
&
alloc
);
&
alloc
,
fc
);
AZ
(
pthread_mutex_unlock
(
&
fco
->
mtx
));
AZ
(
pthread_mutex_unlock
(
&
fco
->
mtx
));
fco
=
NULL
;
fco
=
NULL
;
break
;
break
;
...
@@ -2648,7 +2657,7 @@ fellow_cache_lru_thread(struct worker *wrk, void *priv)
...
@@ -2648,7 +2657,7 @@ fellow_cache_lru_thread(struct worker *wrk, void *priv)
buddy
=
fc
->
membuddy
;
buddy
=
fc
->
membuddy
;
CHECK_OBJ
(
buddy
,
BUDDY_MAGIC
);
CHECK_OBJ
(
buddy
,
BUDDY_MAGIC
);
// fellow_cache_seg_evict_locked()
// fellow_cache_
lru_
seg_evict_locked()
assert_fcos_transition
(
FCS_INCORE
,
FCS_DISK
);
assert_fcos_transition
(
FCS_INCORE
,
FCS_DISK
);
reqs
=
BUDDY_REQS_STK
(
buddy
,
BUDDY_REQS_MAX
);
reqs
=
BUDDY_REQS_STK
(
buddy
,
BUDDY_REQS_MAX
);
...
...
src/fellow_storage.c
View file @
1fc5caf7
...
@@ -381,6 +381,13 @@ sfemem_objslim(struct worker *wrk, struct objcore *memoc)
...
@@ -381,6 +381,13 @@ sfemem_objslim(struct worker *wrk, struct objcore *memoc)
mutate_to_sfeexp
(
memoc
,
xid
);
mutate_to_sfeexp
(
memoc
,
xid
);
return
;
return
;
}
}
/*
* for calls from HSH_Cancel, we could write a new disk object with no
* body. For now, just free any body segments cached in memory
*/
}
}
static
void
v_matchproto_
(
objfree_f
)
static
void
v_matchproto_
(
objfree_f
)
...
...
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