Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pmdk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Egorov, Sergey (PG/R - Comp Sci & Elec Eng)
pmdk
Commits
b444df8c
Commit
b444df8c
authored
5 years ago
by
Piotr Balcer
Browse files
Options
Downloads
Patches
Plain Diff
obj: fix run allocated recalculation
parent
90aff044
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/libpmemobj/heap.c
+1
-1
1 addition, 1 deletion
src/libpmemobj/heap.c
src/test/obj_ctl_stats/obj_ctl_stats.c
+24
-1
24 additions, 1 deletion
src/test/obj_ctl_stats/obj_ctl_stats.c
with
25 additions
and
2 deletions
src/libpmemobj/heap.c
+
1
−
1
View file @
b444df8c
...
...
@@ -616,7 +616,7 @@ heap_reclaim_run(struct palloc_heap *heap, struct memory_block *m, int startup)
STATS_INC
(
heap
->
stats
,
transient
,
heap_run_active
,
m
->
size_idx
*
CHUNKSIZE
);
STATS_INC
(
heap
->
stats
,
transient
,
heap_run_allocated
,
c
->
run
.
nallocs
-
e
.
free_space
);
(
c
->
run
.
nallocs
-
e
.
free_space
)
*
run
->
hdr
.
block_size
)
;
}
if
(
recycler_put
(
heap
->
rt
->
recyclers
[
c
->
id
],
m
,
e
)
<
0
)
...
...
This diff is collapsed.
Click to expand it.
src/test/obj_ctl_stats/obj_ctl_stats.c
+
24
−
1
View file @
b444df8c
/*
* Copyright 2017-20
19
, Intel Corporation
* Copyright 2017-20
20
, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
...
...
@@ -122,6 +122,29 @@ main(int argc, char *argv[])
UT_ASSERTeq
(
ret
,
0
);
UT_ASSERTeq
(
tmp
,
run_allocated
);
/* shouldn't change */
/* the deallocated object shouldn't be reflected in rebuilt stats */
pmemobj_free
(
&
oid
);
pmemobj_close
(
pop
);
pop
=
pmemobj_open
(
path
,
"ctl"
);
UT_ASSERTne
(
pop
,
NULL
);
/* stats are rebuilt lazily, so initially this should be 0 */
tmp
=
0
;
ret
=
pmemobj_ctl_get
(
pop
,
"stats.heap.run_allocated"
,
&
tmp
);
UT_ASSERTeq
(
ret
,
0
);
UT_ASSERTeq
(
tmp
,
0
);
ret
=
pmemobj_alloc
(
pop
,
NULL
,
1
,
0
,
NULL
,
NULL
);
UT_ASSERTeq
(
ret
,
0
);
/* after first alloc, the previously allocated object will be found */
tmp
=
0
;
ret
=
pmemobj_ctl_get
(
pop
,
"stats.heap.run_allocated"
,
&
tmp
);
UT_ASSERTeq
(
ret
,
0
);
UT_ASSERTeq
(
tmp
,
run_allocated
+
oid_size
);
pmemobj_close
(
pop
);
DONE
(
NULL
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment