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
librbd/cache/pwl: fix m_bytes_{allocated,cached} calculation on reopen #42883
Conversation
@MahatiC @CongMinYin please review. Thanks |
retest this please |
LGTM |
@MahatiC , ping. |
@MahatiC ping. |
@MahatiC ping |
template <typename I> | ||
void WriteLog<I>::calc_allocated_and_cached_data(std::shared_ptr<pwl::GenericLogEntry> log_entry, uint32_t alloc_size) { | ||
auto gen_write_entry = static_pointer_cast<GenericWriteLogEntry>(log_entry); | ||
if (log_entry->is_write_entry()) { |
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.
Could you explain why this check if (log_entry->write_bytes() == log_entry->bytes_dirty())
is removed? That check will differentiate writesame
from a write
request. In writesame
, we don't allocate all of the write_bytes()
length. I think we need to differentiate when calculating m_bytes_allocated
8789ff6
to
d0b10b4
Compare
d0b10b4
to
fe9e96e
Compare
@idryomov . update please review. |
I would maybe rename |
…load entries. Currently, it will load existing entries after restart and cacl m_bytes_allocated based on those entries. But currently there are the following problems: 1: The allocated of write-same is not calculated for rwl & ssd cache. 2: for ssd cache, it not include the size of log-entry itself and don't consider data alignment. This will cause less calculation and more allocatation later. And will overwrite the data which don't flush to osd and make data lost. The calculation methods of ssd and rwl are different. So add new api allocated_and_cached_data() to implement their own method. For SSD cache, we dirtly use m_first_valid_entry & m_first_free_entry to calc m_bytes_allocated. Fixes:https://tracker.ceph.com/issues/52341 Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
fe9e96e
to
a96ca93
Compare
…load entries.
Currently, it will load existing entries after restart and cacl
m_bytes_allocated based on those entries. But currently there are
the following problems:
1: The allocated of write-same is not calculated for rwl & ssd cache.
2: for ssd cache, it not include the size of log-entry itself and don't
consider data alignment. This will cause less calculation and more
allocatation later. And will overwrite the data which don't flush to osd
and make data lost.
The calculation methods of ssd and rwl are different. So add new api
allocated_and_cached_data() to implement their own method.
For SSD cache, we dirtly use m_first_valid_entry & m_first_free_entry to
calc m_bytes_allocated.
Fixes:https://tracker.ceph.com/issues/52341
Signed-off-by: Jianpeng Ma jianpeng.ma@intel.com
Checklist
Show available Jenkins commands
jenkins retest this please
jenkins test classic perf
jenkins test crimson perf
jenkins test signed
jenkins test make check
jenkins test make check arm64
jenkins test submodules
jenkins test dashboard
jenkins test dashboard cephadm
jenkins test api
jenkins test docs
jenkins render docs
jenkins test ceph-volume all
jenkins test ceph-volume tox