cleaner: Unlock cache mngt lock from queue context

Cache mngt lock cannot be unlocked from io completion context (which is
potentially atomic context) as it may involve sleeping operations.
Modify cleaner utility to support rescheduling to queue context before
calling the completion. Update cleaning policies to use that option.

Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
This commit is contained in:
Robert Baldyga
2024-03-21 15:10:03 +01:00
parent 7e52cfafb9
commit 2398412622
5 changed files with 38 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
/*
* Copyright(c) 2012-2022 Intel Corporation
* Copyright(c) 2024 Huawei Technologies
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -652,6 +653,7 @@ static void _acp_flush(struct acp_context *acp)
.lock_cacheline = false,
.lock_metadata = true,
.do_sort = false,
.cmpl_queue = true,
.io_queue = cache->cleaner.io_queue,
};

View File

@@ -1,6 +1,7 @@
/*
* Copyright(c) 2012-2022 Intel Corporation
* Copyright(c) 2022 David Lee <live4thee@gmail.com>
* Copyright(c) 2024 Huawei Technologies
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -941,6 +942,7 @@ void cleaning_alru_perform_cleaning(ocf_cache_t cache, ocf_cleaner_end_t cmpl)
fctx->attribs.lock_metadata = false;
fctx->attribs.do_sort = true;
fctx->attribs.io_queue = cache->cleaner.io_queue;
fctx->attribs.cmpl_queue = true;
fctx->clines_no = config->flush_max_buffers;
fctx->cache = cache;