Skip to content
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

Split count_pages and update on metadata deinit #861

Merged
merged 2 commits into from
Feb 6, 2025

Conversation

Deixx
Copy link
Contributor

@Deixx Deixx commented Jan 20, 2025

This resets count_pages_variable on cache-detach, so during the following cache-attach metadata size is calculated properly.

@Deixx Deixx changed the title Update count_pages on metadata deinit Update count_pages_variable on metadata deinit Feb 4, 2025
@Deixx Deixx force-pushed the deinit-variable-metadata branch 2 times, most recently from bea7a3d to 26cfd37 Compare February 4, 2025 11:39
@Deixx Deixx changed the title Update count_pages_variable on metadata deinit Split count_pages and update on metadata deinit Feb 4, 2025
@Deixx Deixx force-pushed the deinit-variable-metadata branch 2 times, most recently from a8988c2 to 5d8da33 Compare February 6, 2025 07:58
robertbaldyga
robertbaldyga previously approved these changes Feb 6, 2025
Comment on lines 23 to 25
ocf_cache_line_t start_page;
ocf_cache_line_t count_pages;
ocf_cache_line_t count_pages_fixed;
ocf_cache_line_t count_pages_variable;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ocf_cache_line_t -> uint32_t

OCF_DEBUG_PARAM(cache, "Metadata end pages = %u", ctrl->start_page
+ ctrl->count_pages);
+ ctrl->count_pages_fixed + ctrl->count_pages_variable);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+ ctrl->count_pages_fixed + ctrl->count_pages_variable -> + ocf_metadata_get_pages_count()

@@ -787,7 +789,8 @@ int ocf_metadata_init_variable_size(struct ocf_cache *cache,
cache->device->hash_table_entries =
ctrl->raw_desc[metadata_segment_hash].entries;

cache->device->metadata_offset = ctrl->count_pages * PAGE_SIZE;
cache->device->metadata_offset =
(ctrl->count_pages_fixed + ctrl->count_pages_variable) * PAGE_SIZE;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ctrl->count_pages_fixed + ctrl->count_pages_variable -> ocf_metadata_get_pages_count()

@@ -954,7 +957,7 @@ ocf_cache_line_t ocf_metadata_get_pages_count(struct ocf_cache *cache)

ctrl = (struct ocf_metadata_ctrl *) cache->metadata.priv;

return ctrl->count_pages;
return ctrl->count_pages_fixed + ctrl->count_pages_variable;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the return type of this function

@@ -87,7 +87,7 @@ int ocf_metadata_passive_update(struct ocf_request *master)
return 0;
}

if (io_start_page >= ctrl->count_pages) {
if (io_start_page >= ctrl->count_pages_fixed + ctrl->count_pages_variable) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ocf_metadata_get_pages_count()

@Deixx Deixx force-pushed the deinit-variable-metadata branch 2 times, most recently from f0646ef to db0e776 Compare February 6, 2025 10:53
Deixx added 2 commits February 6, 2025 11:54
This resets count_pages_variable on cache-detach, so during the following
cache-attach metadata size is calculated properly.

Signed-off-by: Daniel Madej <daniel.madej@huawei.com>
Signed-off-by: Daniel Madej <daniel.madej@huawei.com>
@Deixx Deixx force-pushed the deinit-variable-metadata branch from db0e776 to d8feef3 Compare February 6, 2025 10:55
@robertbaldyga robertbaldyga merged commit bb4d673 into Open-CAS:master Feb 6, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants