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
65acc9d4
Unverified
Commit
65acc9d4
authored
Dec 18, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fellow_busy: Add a mempool
Unfortunately, this brings us above 4K, so we fill up with io structs
parent
07f49056
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
2 deletions
+29
-2
fellow_cache.c
src/fellow_cache.c
+29
-2
No files found.
src/fellow_cache.c
View file @
65acc9d4
...
...
@@ -687,6 +687,11 @@ struct fellow_busy_io_seglist {
struct
buddy_off_extent
reg
;
};
// pool for segment memory
BUDDY_POOL
(
fbo_segmem
,
1
);
//BUDDY_POOL_GET_FUNC(fbo_segmem, static)
//BUDDY_POOL_AVAIL_FUNC(fbo_segmem, static)
struct
fellow_busy_io
{
uint16_t
magic
;
#define FELLOW_BUSY_IO_MAGIC 0x0bcb
...
...
@@ -727,13 +732,15 @@ struct fellow_busy {
struct
fellow_cache_seg
*
body_seg
;
struct
fellow_body_region
body_region
;
struct
fbo_segmem
segmem
[
1
];
#define FCO_MAX_REGIONS ((FELLOW_DISK_LOG_BLOCK_ENTRIES - 1) * DLE_REG_NREGION)
// for fdsl and busy region last chance
#define FCO_REGIONS_RESERVE 3
struct
buddy_off_extent
region
[
FCO_MAX_REGIONS
];
unsigned
nregion
;
uint8_t
grown
;
#define FBO_NIO 1
1
#define FBO_NIO 1
00
/* protected by fco mtx */
uint8_t
io_idx
;
uint8_t
io_outstanding
;
...
...
@@ -2014,6 +2021,21 @@ fellow_cache_obj_new(
return
(
fcr
);
}
static
void
fellow_busy_fill_segmem
(
struct
buddy_reqs
*
reqs
,
const
void
*
priv
)
{
const
struct
stvfe_tune
*
tune
;
unsigned
u
,
bits
;
CHECK_OBJ_NOTNULL
(
reqs
,
BUDDY_REQS_MAGIC
);
CAST_OBJ_NOTNULL
(
tune
,
priv
,
STVFE_TUNE_MAGIC
);
bits
=
tune
->
chunk_exponent
;
for
(
u
=
0
;
u
<
reqs
->
space
;
u
++
)
AN
(
buddy_req_page
(
reqs
,
bits
,
0
));
}
struct
fellow_cache_res
fellow_busy_obj_alloc
(
struct
fellow_cache
*
fc
,
struct
fellow_cache_obj
**
fcop
,
uintptr_t
*
priv2
,
...
...
@@ -2140,6 +2162,9 @@ fellow_busy_obj_alloc(struct fellow_cache *fc,
*/
fbo
->
io_outstanding
=
1
;
BUDDY_POOL_INIT
(
fbo
->
segmem
,
fc
->
membuddy
,
FEP_SPC
,
fellow_busy_fill_segmem
,
fc
->
tune
);
return
(
FCR_OK
(
fbo
));
}
...
...
@@ -4723,6 +4748,8 @@ fellow_busy_done(struct fellow_busy *fbo, struct objcore *oc, unsigned inlog)
fc
=
fbo
->
fc
;
CHECK_OBJ_NOTNULL
(
fc
,
FELLOW_CACHE_MAGIC
);
BUDDY_POOL_FINI
(
fbo
->
segmem
);
// nicer way?
if
(
fbo
->
body_seg
!=
NULL
)
fellow_busy_obj_trimstore
(
fbo
);
...
...
@@ -6562,7 +6589,7 @@ main(int argc, char **argv)
fn
=
argv
[
1
];
DBG
(
"fellow_busy %zu"
,
sizeof
(
struct
fellow_busy
));
assert
(
sizeof
(
struct
fellow_busy
)
<=
MIN_FELLOW_BLOCK
);
assert
(
sizeof
(
struct
fellow_busy
)
<=
2
*
MIN_FELLOW_BLOCK
);
t_tailq_concat
();
...
...
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