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
818588cc
Unverified
Commit
818588cc
authored
Sep 19, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test reaching objsize_max under simulated memory pressure
Tests #22
parent
e7976b24
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
fellow_cache.c
src/fellow_cache.c
+26
-0
No files found.
src/fellow_cache.c
View file @
818588cc
...
...
@@ -2126,6 +2126,9 @@ fellow_busy_region_alloc(struct fellow_busy *fbo, size_t size, int8_t cram)
assert
(
fbo
->
nregion
<
FCO_MAX_REGIONS
);
fdr
=
&
fbo
->
region
[
fbo
->
nregion
];
if
(
cram
)
FC_INJ_SZLIM
(
size
);
*
fdr
=
FC_INJ
?
buddy_off_extent_nil
:
fellow_region_alloc
(
fc
->
ffd
,
FEP_SPC
,
size
,
cram
);
...
...
@@ -5639,6 +5642,29 @@ t_cache(unsigned chksum)
test_bocdone
(
fbo
,
TRUST_ME
(
hash
),
1
);
fellow_cache_obj_deref
(
fc
,
fco
);
// === hit objsize_max under memory pressure
fbo
=
fellow_busy_obj_alloc
(
fc
,
&
fco
,
&
priv2
,
1234
).
r
.
ptr
;
CHECK_OBJ_NOTNULL
(
fbo
,
FELLOW_BUSY_MAGIC
);
do
{
char
*
ptr
;
if
(
fbo
->
nregion
<
FCO_MAX_REGIONS
-
FCO_REGIONS_RESERVE
)
FC_INJ_SZLIM_SET
(
4096
);
sz
=
1234
;
fcr
=
fellow_busy_obj_getspace
(
fbo
,
&
sz
,
(
uint8_t
**
)
&
ptr
);
if
(
fcr
.
status
==
fcr_ok
)
{
fellow_busy_obj_extend
(
fbo
,
sz
);
continue
;
}
assert
(
fcr
.
status
==
fcr_allocerr
);
AZ
(
strcmp
(
fcr
.
r
.
err
,
"objsize_max reached"
));
}
while
(
fcr
.
status
==
fcr_ok
);
fellow_busy_obj_trimstore
(
fbo
);
test_bocdone
(
fbo
,
TRUST_ME
(
hash
),
1
);
fellow_cache_obj_deref
(
fc
,
fco
);
test_fellow_cache_unbusy_inject
(
fc
);
// === alloc, then evict
...
...
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