-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Object stats #616
base: main
Are you sure you want to change the base?
Object stats #616
Conversation
snmalloc::RemoteDeallocCache::remote_inflight tracks the amount of bytes that are inbetween threads.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments so far; posting before switching threads.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks quite nice. ISTR snmalloc
of old had the ability to conditionally keep stats or not; perhaps it would be worth having an empty implementation of the Stat
and MonotoneStat
interfaces and either templating or having a namespace snmalloc
-scoped using
to pick between them?
src/snmalloc/mem/globalalloc.h
Outdated
@@ -87,6 +87,10 @@ namespace snmalloc | |||
} | |||
} | |||
|
|||
if ( | |||
result == nullptr && RemoteDeallocCache::remote_inflight.get_curr() != 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something has happened (TM) with the syntax there. Can this be a SNMALLOC_ASSERT_MSG
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks quite nice. ISTR snmalloc
of old had the ability to conditionally keep stats or not; perhaps it would be worth having an empty implementation of the Stat
and MonotoneStat
interfaces and either templating or having a namespace snmalloc
-scoped using
to pick between them?
I was going to profile to see how much the operations cost. If they are noticeable, then I will macro it away as you suggest. |
This adds some statistic for tracking
The per sizeclass statistics are tracked per allocator, and a racy read is done to combine the results for displaying.
These statistics were used to debug #615 to calculate the fragmentation.
The displayed statistics are intended for post processing to calculate the fragmentation/utilisation.
The interface just prints the results using
message
. This could be improved with a better logging infrastructure.