cleaner: Move sort functionality to flush_data abstraction

The flush_data is used by ocf_cleaner_do_flush_data_async(), which means
that callers of ocf_cleaner_fire() are now expected to guarantee that
entries are returned by getter in a sorted order. Currently the only case
when ocf_cleaner_fire() is called directly is for request cleaning, and
the request map is sorted by definition.

Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
This commit is contained in:
Robert Baldyga
2024-06-14 13:37:36 +02:00
parent dd4add45e1
commit 2b94a3ab31
5 changed files with 16 additions and 44 deletions

View File

@@ -652,7 +652,6 @@ static void _acp_flush(struct acp_context *acp)
.cmpl_fn = _acp_flush_end,
.lock_cacheline = false,
.lock_metadata = true,
.do_sort = false,
.cmpl_queue = true,
.io_queue = cache->cleaner.io_queue,
};

View File

@@ -911,8 +911,9 @@ static void alru_clean(struct alru_context *ctx)
to_clean = get_data_to_flush(ctx);
if (to_clean > 0) {
fctx->flush_perfomed = true;
ocf_cleaner_do_flush_data_async(cache, fctx->flush_data, to_clean,
&fctx->attribs);
ocf_cleaner_sort_flush_data(fctx->flush_data, to_clean);
ocf_cleaner_do_flush_data_async(cache, fctx->flush_data,
to_clean, &fctx->attribs);
ocf_metadata_end_exclusive_access(&cache->metadata.lock);
return;
}
@@ -940,7 +941,6 @@ void cleaning_alru_perform_cleaning(ocf_cache_t cache, ocf_cleaner_end_t cmpl)
fctx->attribs.cmpl_fn = alru_clean_complete;
fctx->attribs.lock_cacheline = true;
fctx->attribs.lock_metadata = false;
fctx->attribs.do_sort = true;
fctx->attribs.io_queue = cache->cleaner.io_queue;
fctx->attribs.cmpl_queue = true;