Check relaxation condition in each step of flush loop
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
parent
4d61d56249
commit
fd328bd0a1
@ -165,25 +165,20 @@ static int _ocf_mngt_get_sectors(ocf_cache_t cache, ocf_core_id_t core_id,
|
|||||||
ocf_metadata_get_core_info(cache, line, &i_core_id,
|
ocf_metadata_get_core_info(cache, line, &i_core_id,
|
||||||
&core_line);
|
&core_line);
|
||||||
|
|
||||||
if (i_core_id != core_id)
|
if (i_core_id == core_id &&
|
||||||
continue;
|
metadata_test_valid_any(cache, line) &&
|
||||||
|
metadata_test_dirty(cache, line)) {
|
||||||
|
/* It's valid and dirty target core cacheline */
|
||||||
|
elem->cache_line = line;
|
||||||
|
elem->core_line = core_line;
|
||||||
|
elem->core_id = i_core_id;
|
||||||
|
elem++;
|
||||||
|
dirty_found++;
|
||||||
|
|
||||||
if (!metadata_test_valid_any(cache, line))
|
/* stop if all cachelines were found */
|
||||||
continue;
|
if (dirty_found == dirty_total)
|
||||||
|
break;
|
||||||
if (!metadata_test_dirty(cache, line))
|
}
|
||||||
continue;
|
|
||||||
|
|
||||||
/* It's core_id cacheline and it's valid and it's dirty! */
|
|
||||||
elem->cache_line = line;
|
|
||||||
elem->core_line = core_line;
|
|
||||||
elem->core_id = i_core_id;
|
|
||||||
elem++;
|
|
||||||
dirty_found++;
|
|
||||||
|
|
||||||
/* stop if all cachelines were found */
|
|
||||||
if (dirty_found == dirty_total)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if ((line + 1) % 1000000 == 0) {
|
if ((line + 1) % 1000000 == 0) {
|
||||||
ocf_metadata_end_exclusive_access(
|
ocf_metadata_end_exclusive_access(
|
||||||
@ -272,26 +267,23 @@ static int _ocf_mngt_get_flush_containers(ocf_cache_t cache,
|
|||||||
for (line = 0; line < cache->device->collision_table_entries; line++) {
|
for (line = 0; line < cache->device->collision_table_entries; line++) {
|
||||||
ocf_metadata_get_core_info(cache, line, &core_id, &core_line);
|
ocf_metadata_get_core_info(cache, line, &core_id, &core_line);
|
||||||
|
|
||||||
if (!metadata_test_valid_any(cache, line))
|
if (metadata_test_valid_any(cache, line) &&
|
||||||
continue;
|
metadata_test_dirty(cache, line)) {
|
||||||
|
curr = &fc[core_revmap[core_id]];
|
||||||
|
|
||||||
if (!metadata_test_dirty(cache, line))
|
ENV_BUG_ON(curr->iter >= curr->count);
|
||||||
continue;
|
|
||||||
|
|
||||||
curr = &fc[core_revmap[core_id]];
|
/* It's core_id cacheline and it's valid and it's dirty! */
|
||||||
|
curr->flush_data[curr->iter].cache_line = line;
|
||||||
|
curr->flush_data[curr->iter].core_line = core_line;
|
||||||
|
curr->flush_data[curr->iter].core_id = core_id;
|
||||||
|
curr->iter++;
|
||||||
|
dirty_found++;
|
||||||
|
|
||||||
ENV_BUG_ON(curr->iter >= curr->count);
|
/* stop if all cachelines were found */
|
||||||
|
if (dirty_found == dirty_total)
|
||||||
/* It's core_id cacheline and it's valid and it's dirty! */
|
break;
|
||||||
curr->flush_data[curr->iter].cache_line = line;
|
}
|
||||||
curr->flush_data[curr->iter].core_line = core_line;
|
|
||||||
curr->flush_data[curr->iter].core_id = core_id;
|
|
||||||
curr->iter++;
|
|
||||||
dirty_found++;
|
|
||||||
|
|
||||||
/* stop if all cachelines were found */
|
|
||||||
if (dirty_found == dirty_total)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if ((line + 1) % 1000000 == 0) {
|
if ((line + 1) % 1000000 == 0) {
|
||||||
ocf_metadata_end_exclusive_access(
|
ocf_metadata_end_exclusive_access(
|
||||||
|
Loading…
Reference in New Issue
Block a user