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
6bdb638a
Unverified
Commit
6bdb638a
authored
Nov 13, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split seglist allocation heuristic from actual allocation
parent
da5131fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
15 deletions
+32
-15
fellow_cache.c
src/fellow_cache.c
+32
-15
No files found.
src/fellow_cache.c
View file @
6bdb638a
...
...
@@ -2212,35 +2212,26 @@ fellow_busy_region_free(struct fellow_busy *fbo, struct buddy_off_extent *fdr)
static
uint16_t
XXX_LIMIT_LDSEGS
=
0
;
#endif
static
struct
fellow_cache_res
fellow_disk_seglist_alloc
(
struct
fellow_busy
*
fbo
,
struct
fellow_cache_seglist
*
ofcsl
,
uint16_t
ldsegs
,
uint8_t
fht
);
static
struct
fellow_cache_res
fellow_busy_body_seglist_alloc
(
struct
fellow_busy
*
fbo
,
struct
fellow_cache_seglist
*
ofcsl
)
{
struct
fellow_disk_seglist
*
ofdsl
,
*
fdsl
;
struct
fellow_cache_seglist
*
fcsl
;
struct
fellow_cache
*
fc
;
struct
buddy_off_extent
*
fdr
;
struct
buddy_ptr_extent
fdsl_mem
,
fcsl_mem
;
struct
buddy_reqs
*
reqs
;
unsigned
chunk_exponent
,
u
;
unsigned
chunk_exponent
;
uint16_t
ldsegs
;
size_t
sz
;
CHECK_OBJ_NOTNULL
(
fbo
,
FELLOW_BUSY_MAGIC
);
CHECK_OBJ_NOTNULL
(
ofcsl
,
FELLOW_CACHE_SEGLIST_MAGIC
);
AZ
(
ofcsl
->
next
);
ofdsl
=
ofcsl
->
fdsl
;
AZ
(
ofdsl
->
next
.
off
);
AZ
(
ofdsl
->
next
.
size
);
fc
=
fbo
->
fc
;
CHECK_OBJ_NOTNULL
(
fc
,
FELLOW_CACHE_MAGIC
);
CHECK_OBJ_NOTNULL
(
fc
->
tune
,
STVFE_TUNE_MAGIC
);
chunk_exponent
=
fc
->
tune
->
chunk_exponent
;
assert
(
fbo
->
sz_estimate
>
fbo
->
sz_returned
);
if
(
fbo
->
grown
)
{
...
...
@@ -2259,6 +2250,32 @@ fellow_busy_body_seglist_alloc(struct fellow_busy *fbo,
ldsegs
=
XXX_LIMIT_LDSEGS
;
#endif
return
(
fellow_disk_seglist_alloc
(
fbo
,
ofcsl
,
ldsegs
,
fc
->
tune
->
hash_obj
));
}
static
struct
fellow_cache_res
fellow_disk_seglist_alloc
(
struct
fellow_busy
*
fbo
,
struct
fellow_cache_seglist
*
ofcsl
,
uint16_t
ldsegs
,
uint8_t
fht
)
{
struct
fellow_cache_seglist
*
fcsl
;
struct
fellow_disk_seglist
*
ofdsl
,
*
fdsl
;
struct
buddy_off_extent
*
fdr
;
struct
buddy_ptr_extent
fdsl_mem
,
fcsl_mem
;
struct
buddy_reqs
*
reqs
;
unsigned
u
;
size_t
sz
;
CHECK_OBJ_NOTNULL
(
fbo
,
FELLOW_BUSY_MAGIC
);
CHECK_OBJ_NOTNULL
(
ofcsl
,
FELLOW_CACHE_SEGLIST_MAGIC
);
AZ
(
ofcsl
->
next
);
ofdsl
=
ofcsl
->
fdsl
;
AZ
(
ofdsl
->
next
.
off
);
AZ
(
ofdsl
->
next
.
size
);
sz
=
fellow_disk_seglist_size
(
fdsl
,
ldsegs
);
fdr
=
fellow_busy_region_alloc
(
fbo
,
sz
,
0
);
...
...
@@ -2293,7 +2310,7 @@ fellow_busy_body_seglist_alloc(struct fellow_busy *fbo,
fdsl
=
fdsl_mem
.
ptr
;
AN
(
fdsl
);
assert
(
fdsl_mem
.
size
==
fdr
->
size
);
fellow_disk_seglist_init
(
fdsl
,
ldsegs
,
f
c
->
tune
->
hash_obj
);
fellow_disk_seglist_init
(
fdsl
,
ldsegs
,
f
ht
);
fcsl
=
fcsl_mem
.
ptr
;
AN
(
fcsl
);
...
...
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