-
Notifications
You must be signed in to change notification settings - Fork 103
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
atomic_bitmap: add capability to reset bits range #270
atomic_bitmap: add capability to reset bits range #270
Conversation
f23405b
to
3ce1612
Compare
65d1d37
to
8711bdc
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
src/bitmap/backend/atomic_bitmap.rs
Outdated
/// is for the page corresponding to `start_addr`, and the last bit that we set corresponds | ||
/// to address `start_addr + len - 1`. | ||
pub fn reset_addr_range(&self, start_addr: usize, len: usize) { | ||
self.set_reset_addr_range(start_addr, len, true); |
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.
Just a nitpick, but it's a bit counter-intuitive in my opinion that the third argument being set to true
means that the bits are set to zero, I would expect the opposite. Otherwise LGTM.
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.
@00xc Fixed now
bfe91ca
to
4d4df5c
Compare
@00xc Could you please take another look into this PR? |
Currently, there is no implementation to reset a single bit or bit range for AtomicBitmap struct. This patch adds necessary function to reset a specific bit or a bit range. This use case is needed for Cloud-Hypervisor in managing page cache for Microsoft Hypervisor related to SEV-SNP guest. Rather than implementing a new one , it is helpful to add feature to this struct. Signed-off-by: Muminul Islam <[email protected]>
4d4df5c
to
172427a
Compare
Pinging again: @alexandruag @bonzini @jiangliu |
Currently, there is no implementation to reset a single bit or bit range for AtomicBitmap struct. This patch adds necessary function to reset a specific bit or a bit range. This use case is needed for Cloud-Hypervisor in managing page cache for Microsoft Hypervisor related to SEV-SNP guest. Rather than implementing a new one , it is helpful to add feature to this struct.
Summary of the PR
Please summarize here why the changes in this PR are needed.
Requirements
Before submitting your PR, please make sure you addressed the following
requirements:
git commit -s
), and the commitmessage has max 60 characters for the summary and max 75 characters for each
description line.
test.
Release" section of CHANGELOG.md (if no such section exists, please create one).
unsafe
code is properly documented.