-
Notifications
You must be signed in to change notification settings - Fork 72
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
Accurate memory tracking of immutable memory #132
Conversation
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.
I left a few minor comments, but other than that LGTM. Can you also add a test or two to ensure the new functionality doesn't regress in the future?
// Note that the memory_inactive_ and memory_being_freed_ counters | ||
// are NOT maintained when the WBM is disabled. In addition, memory_used_ is | ||
// maintained only when enabled or cache is provided. Therefore, if switching | ||
// from disabled to enabled, these counters will (or may) be invalid or may | ||
// wraparound |
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.
This seems like an upstream bug, regardless of the changes in this PR. Can we open a separate issue to fix this (i.e. track memory state even when disabled in order to avoid this scenario) and make this PR depend on it?
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.
I have opened https://github.com/speedb-io/speedb/issues/138
How do we make a PR depend on it and what does it mean practically?
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.
Thanks!
We currently have no means of specifying that a PR depends on an issue or another PR because the automation is still a WIP, so generally making something dependent on another is currently simply adding Depends on ...
to the PR description and avoiding merging it until the other one is resolved. My thinking was that since that's an upstream bug, it would be better if we fixed it before making the changes in this PR, so that it'd be easier to upstream. However, thinking about it some more, I don't think that the failure case justifies holding back this PR if you won't have time to open a PR for the other issue and add a regression test.
bc26987
to
8118efb
Compare
a440fea
to
408870c
Compare
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.
Sorry for the small bursts of comments. Only 2 minor comments this time, and hopefully it'll be the last round.
|
||
uint64_t GetFileNumber() const { return file_number_; } | ||
|
||
void SetFileNumber(uint64_t file_num) { file_number_ = file_num; } | ||
|
||
void SetFlushInProgress(bool in_progress) { | ||
if (in_progress && (flush_in_progress_ == false)) { |
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.
Can we simplify the check by wrapping this in if (in_progress != flush_in_progress_)
, so that inside we'll only need to check if the new value is true
or not? It took me a couple of reads to understand that this is basically what the checks are all about.
408870c
to
6cc4a50
Compare
@isaac-io - Please review the last commit. Thanks |
6cc4a50
to
0aed128
Compare
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.
LGTM.
0aed128
to
6f2669a
Compare
I have squashed and pushed the branch |
6f2669a
to
7433613
Compare
No description provided.