Compare commits
10 Commits
c7e47e226a
...
8e3aab2f45
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8e3aab2f45 | ||
![]() |
6811d562d5 | ||
![]() |
a63479c7cd | ||
![]() |
6e1153660b | ||
![]() |
9df3c6a97a | ||
![]() |
ea58dde0ea | ||
![]() |
6bb00db1ff | ||
![]() |
f13279b0d6 | ||
![]() |
bea7340e69 | ||
![]() |
dacbe68a19 |
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@ -0,0 +1 @@
|
||||
tests/** -linguist-detectable
|
@ -383,6 +383,11 @@ static void _ocf_mngt_deinit_added_cores(
|
||||
if (context->cfg.open_cores)
|
||||
ocf_volume_close(volume);
|
||||
|
||||
if (core->front_volume.opened) {
|
||||
ocf_volume_close(&core->front_volume);
|
||||
ocf_volume_deinit(&core->front_volume);
|
||||
}
|
||||
|
||||
if (core->seq_cutoff)
|
||||
ocf_core_seq_cutoff_deinit(core);
|
||||
|
||||
|
@ -595,6 +595,7 @@ static int _ocf_cleaner_check_map(struct ocf_request *req)
|
||||
{
|
||||
ocf_core_id_t core_id;
|
||||
uint64_t core_line;
|
||||
bool nothing_to_submit = true;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < req->core_line_count; ++i) {
|
||||
@ -611,6 +612,12 @@ static int _ocf_cleaner_check_map(struct ocf_request *req)
|
||||
continue;
|
||||
|
||||
req->map[i].flush = true;
|
||||
nothing_to_submit = false;
|
||||
}
|
||||
|
||||
if (nothing_to_submit) {
|
||||
_ocf_cleaner_finish_req(req);
|
||||
return 0;
|
||||
}
|
||||
|
||||
_ocf_cleaner_fire_cache(req);
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright(c) 2019-2022 Intel Corporation
|
||||
* Copyright(c) 2023-2024 Huawei Technologies
|
||||
* Copyright(c) 2023-2025 Huawei Technologies
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
@ -10,6 +10,14 @@
|
||||
#include "../ocf_request.h"
|
||||
#include "utils_pipeline.h"
|
||||
|
||||
#define OCF_PL_DEBUG 0
|
||||
#if OCF_PL_DEBUG == 1
|
||||
#define OCF_DEBUG_LOG(cache, format, ...) \
|
||||
ocf_cache_log(cache, log_debug, format, ##__VA_ARGS__)
|
||||
#else
|
||||
#define OCF_DEBUG_LOG(cache, format, ...)
|
||||
#endif
|
||||
|
||||
#define OCF_PIPELINE_ALIGNMENT 64
|
||||
|
||||
struct ocf_pipeline {
|
||||
@ -37,7 +45,7 @@ static int _ocf_pipeline_run_step(struct ocf_request *req)
|
||||
|
||||
while (true) {
|
||||
step = &pipeline->properties->steps[pipeline->next_step];
|
||||
ocf_cache_log(req->cache, log_debug, "PL STEP: %s\n", step->name);
|
||||
OCF_DEBUG_LOG(req->cache, "PL STEP: %s\n", step->name);
|
||||
switch (step->type) {
|
||||
case ocf_pipeline_step_single:
|
||||
pipeline->next_step++;
|
||||
|
@ -17,6 +17,7 @@ from pyocf.types.io import IoDir, Sync
|
||||
from pyocf.types.queue import Queue
|
||||
from pyocf.utils import Size as S
|
||||
from pyocf.types.shared import OcfError, OcfErrorCode, OcfCompletion, CacheLineSize
|
||||
from pyocf.rio import Rio, ReadWrite
|
||||
|
||||
|
||||
@pytest.mark.parametrize("cache_mode", CacheMode)
|
||||
@ -152,13 +153,15 @@ def test_detach_cache_detach_core_cleaning(pyocf_ctx, cleaning_policy, promotion
|
||||
cache.set_promotion_policy(promotion_policy)
|
||||
|
||||
for core in [core_1, core_2]:
|
||||
vol = CoreVolume(core)
|
||||
queue = core.cache.get_default_queue()
|
||||
|
||||
core_size = core.get_stats()["size"]
|
||||
data = Data(core_size.B)
|
||||
|
||||
_io_to_core(vol, queue, data)
|
||||
r = (
|
||||
Rio()
|
||||
.target(CoreVolume(core))
|
||||
.readwrite(ReadWrite.WRITE)
|
||||
.size(core.get_stats()["size"])
|
||||
.qd(1)
|
||||
.bs(S.from_KiB(64))
|
||||
.run([core.cache.get_default_queue()])
|
||||
)
|
||||
|
||||
core_1.detach()
|
||||
|
||||
@ -178,13 +181,15 @@ def test_detach_cache_retach_core_cleaning(pyocf_ctx, cleaning_policy, promotion
|
||||
|
||||
def _write_cores(cores_list):
|
||||
for core in cores_list:
|
||||
vol = CoreVolume(core)
|
||||
queue = core.cache.get_default_queue()
|
||||
|
||||
core_size = core.get_stats()["size"]
|
||||
data = Data(core_size.B)
|
||||
|
||||
_io_to_core(vol, queue, data)
|
||||
r = (
|
||||
Rio()
|
||||
.target(CoreVolume(core))
|
||||
.readwrite(ReadWrite.WRITE)
|
||||
.size(core.get_stats()["size"])
|
||||
.qd(1)
|
||||
.bs(S.from_KiB(64))
|
||||
.run([core.cache.get_default_queue()])
|
||||
)
|
||||
|
||||
cache.add_core(core_1)
|
||||
cache.add_core(core_2)
|
||||
@ -222,13 +227,15 @@ def test_reattach_cache_reattach_core_cleaning(pyocf_ctx, cleaning_policy, promo
|
||||
|
||||
def _write_cores(cores_list):
|
||||
for core in cores_list:
|
||||
vol = CoreVolume(core)
|
||||
queue = core.cache.get_default_queue()
|
||||
|
||||
core_size = core.get_stats()["size"]
|
||||
data = Data(core_size.B)
|
||||
|
||||
_io_to_core(vol, queue, data)
|
||||
r = (
|
||||
Rio()
|
||||
.target(CoreVolume(core))
|
||||
.readwrite(ReadWrite.WRITE)
|
||||
.size(core.get_stats()["size"])
|
||||
.qd(1)
|
||||
.bs(S.from_KiB(64))
|
||||
.run([core.cache.get_default_queue()])
|
||||
)
|
||||
|
||||
cache.add_core(core_1)
|
||||
cache.add_core(core_2)
|
||||
|
@ -25,6 +25,7 @@ from pyocf.types.shared import (
|
||||
from pyocf.types.volume import RamVolume
|
||||
from pyocf.types.volume_core import CoreVolume
|
||||
from pyocf.utils import Size
|
||||
from pyocf.rio import Rio, ReadWrite
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@ -96,17 +97,15 @@ def test_d2c_io(pyocf_ctx):
|
||||
|
||||
cache.detach_device()
|
||||
|
||||
vol = CoreVolume(core_1)
|
||||
queue = core_1.cache.get_default_queue()
|
||||
data = Data(4096)
|
||||
vol.open()
|
||||
io = vol.new_io(queue, 0, data.size, IoDir.WRITE, 0, 0)
|
||||
io.set_data(data)
|
||||
|
||||
completion = Sync(io).submit()
|
||||
|
||||
vol.close()
|
||||
assert completion.results["err"] == 0
|
||||
r = (
|
||||
Rio()
|
||||
.target(CoreVolume(core_1))
|
||||
.readwrite(ReadWrite.WRITE)
|
||||
.size(core_1.get_stats()["size"])
|
||||
.qd(1)
|
||||
.bs(Size.from_KiB(64))
|
||||
.run([core_1.cache.get_default_queue()])
|
||||
)
|
||||
|
||||
|
||||
def test_detach_cache_zero_superblock(pyocf_ctx):
|
||||
|
Loading…
Reference in New Issue
Block a user