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
0dc29eee
Unverified
Commit
0dc29eee
authored
Dec 19, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fellow_busy: Use the mempool
parent
65acc9d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
4 deletions
+20
-4
fellow_cache.c
src/fellow_cache.c
+20
-4
No files found.
src/fellow_cache.c
View file @
0dc29eee
...
@@ -689,7 +689,7 @@ struct fellow_busy_io_seglist {
...
@@ -689,7 +689,7 @@ struct fellow_busy_io_seglist {
// pool for segment memory
// pool for segment memory
BUDDY_POOL
(
fbo_segmem
,
1
);
BUDDY_POOL
(
fbo_segmem
,
1
);
//
BUDDY_POOL_GET_FUNC(fbo_segmem, static)
BUDDY_POOL_GET_FUNC
(
fbo_segmem
,
static
)
//BUDDY_POOL_AVAIL_FUNC(fbo_segmem, static)
//BUDDY_POOL_AVAIL_FUNC(fbo_segmem, static)
struct
fellow_busy_io
{
struct
fellow_busy_io
{
...
@@ -4263,10 +4263,12 @@ fellow_busy_body_seg_next(struct fellow_busy *fbo)
...
@@ -4263,10 +4263,12 @@ fellow_busy_body_seg_next(struct fellow_busy *fbo)
*
*
* used for body and auxattr
* used for body and auxattr
*/
*/
static
size_t
fellow_busy_seg_memalloc
(
const
struct
fellow_busy
*
fbo
,
static
size_t
fellow_busy_seg_memalloc
(
struct
fellow_busy
*
fbo
,
struct
fellow_cache_seg
*
fcs
,
int8_t
cram
)
struct
fellow_cache_seg
*
fcs
,
int8_t
cram
)
{
{
struct
fellow_disk_seg
*
fds
;
struct
fellow_disk_seg
*
fds
;
struct
buddy_ptr_page
mem
;
size_t
sz
;
CHECK_OBJ_NOTNULL
(
fcs
,
FELLOW_CACHE_SEG_MAGIC
);
CHECK_OBJ_NOTNULL
(
fcs
,
FELLOW_CACHE_SEG_MAGIC
);
fds
=
fcs
->
disk_seg
;
fds
=
fcs
->
disk_seg
;
...
@@ -4286,8 +4288,22 @@ static size_t fellow_busy_seg_memalloc(const struct fellow_busy *fbo,
...
@@ -4286,8 +4288,22 @@ static size_t fellow_busy_seg_memalloc(const struct fellow_busy *fbo,
cram
=
buddy_cramlimit_bits
(
fds
->
seg
.
size
,
cram
=
buddy_cramlimit_bits
(
fds
->
seg
.
size
,
fbo
->
fc
->
tune
->
cram
,
MIN_FELLOW_BITS
);
fbo
->
fc
->
tune
->
cram
,
MIN_FELLOW_BITS
);
}
}
fcs
->
alloc
=
buddy_alloc1_ptr_extent_wait
(
fbo
->
fc
->
membuddy
,
FEP_SPC
,
fds
->
seg
.
size
,
cram
);
mem
=
buddy_get_next_ptr_page
(
fbo_segmem_get
(
fbo
->
segmem
,
fbo
->
fc
->
tune
));
AN
(
mem
.
ptr
);
sz
=
(
size_t
)
1
<<
mem
.
bits
;
if
(
sz
>=
fds
->
seg
.
size
)
{
fcs
->
alloc
.
ptr
=
mem
.
ptr
;
fcs
->
alloc
.
size
=
sz
;
buddy_trim1_ptr_extent
(
fbo
->
fc
->
membuddy
,
&
fcs
->
alloc
,
fds
->
seg
.
size
);
}
else
{
buddy_return1_ptr_page
(
fbo
->
fc
->
membuddy
,
&
mem
);
fcs
->
alloc
=
buddy_alloc1_ptr_extent_wait
(
fbo
->
fc
->
membuddy
,
FEP_SPC
,
fds
->
seg
.
size
,
cram
);
}
if
(
fcs
->
alloc
.
ptr
==
NULL
)
if
(
fcs
->
alloc
.
ptr
==
NULL
)
return
(
0
);
return
(
0
);
...
...
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