Commit Graph

189 Commits

Author SHA1 Message Date
Sara Merzel
835eb708b5 Introduce pass-through block stats
Signed-off-by: Sara Merzel <sara.merzel@huawei.com>
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-09-06 14:47:02 +02:00
Robert Baldyga
3ebf6e64c1
Merge pull request #808 from mmichal10/vol_and_req_fixes
Volume improvements
2024-09-06 14:24:48 +02:00
Amir Haroush
ed62866324 Modify ocf_mngt_get_ram_needed to never fail
Signed-off-by: Amir Haroush <amir.haroush@huawei.com>
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-09-05 15:41:54 +02:00
Gershon Geva
2096e34489 Pass user's params when opening a core volume
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-09-04 20:29:41 +02:00
Michal Mielewczyk
53756e81be Queue visitor API
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-08-29 10:45:57 +02:00
Robert Baldyga
8db93260ae Avoid adding mngt_queue to io_queues list
Previously every created queue was added to io_queues list, which
made mngt_queue being used in ocf_parallelize. Change mngt_queue creation
API so that mngt_queue is not added to the list and doesn't have
unnecessary functionalities initialized.

Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-08-29 10:45:26 +02:00
Michal Mielewczyk
83ec255458 Disable changing cache params for detached cache
Majority of management operations should be blocked for detached cache,
although adding and removing cores should be possible.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-07-10 16:19:37 +02:00
Michal Mielewczyk
047e07c062 Rename cache "initializing" state to "detached"
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-07-10 16:18:04 +02:00
Michal Mielewczyk
e557fd4f64 Fix comment
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-07-10 16:13:45 +02:00
Amir Haroush
6cb1ff71c2 Add OCF API ocf_cache_is_initializing
Signed-off-by: Amir Haroush <amir.haroush@huawei.com>
Signed-off-by: Shai Fultheim <shai.fultheim@huawei.com>
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2023-03-30 10:34:05 +02:00
David Lee
004e930a9f update copyright line as per requested
Signed-off-by: David Lee <live4thee@gmail.com>
2022-10-09 22:30:36 +08:00
David Lee
6184ad7759 alru: add parameter `max_dirty_ratio'
With a high dirty ratio and occupancy, OCF might unable to map cache lines
for new requests, thus pass-through the I/O to core devices.  IOPS will
drop afterwards.  We need to control the dirty ratio.

Existing `alru' policy gives user the chance to control the stale buffer
time, activity threshold etc.  They can affect the dirty ratio of the cache
device, but in an empirical manner, more or less.  Introducing
`max_dirty_ratio' can make it explicit.

At first glance, it might be better to implement a dedicated cleaner policy
directly targeting dirty ratio goal, so that the `alru' parameters remains
orthogonal.  But one the other hand, we still need to flush dirty cache
lines periodically, instead of just keeping a watermark of dirty ratio.
It indicates that existing `alru' parameters are still required if we
develop a new policy, and it seems reasonable to make it a parameter.

To sum up, this patch does the following:
- added a 'max_dirty_ratio' parameter with default value 100;
- with default value 100, `alru' cleaner is identical to what is was;
- with value N less than 100, the cleaner (when waken up) will active
  brought dirty ratio to N, regardless of staleness time.

Signed-off-by: David Lee <live4thee@gmail.com>
2022-10-01 17:48:14 +08:00
David Lee
d6b0fbceac a few typo fixes
Signed-off-by: David Lee <live4thee@gmail.com>
2022-10-01 17:48:07 +08:00
Adam Rutkowski
5a80237e74 expose composite volume type id in API
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-06-13 11:40:08 +02:00
Robert Baldyga
b847fa9a61 Introduce composite volume
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-06-02 09:49:39 +02:00
Robert Baldyga
8858e7344d Replace uuid/type pair with volume object in the device config
It makes it possible to attach/load cache using volume types that have
non-standard constructors.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-06-02 09:49:39 +02:00
Robert Baldyga
c9ea68f3bf Introduce on_init/on_deinit ops in ocf_volume interface
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-06-02 09:49:39 +02:00
Robert Baldyga
d4df912f46 Add option to disable cleaner
This allows to avoid allocating cleaner metadata section and effectively
save up to 20% of metadata memory footprint.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-04-28 13:04:27 +02:00
Robert Baldyga
a64fc61413
Merge pull request #666 from arutk/pyocf_vol_cleaniup
pyocf: volume changes required for failover tests
2022-03-29 10:02:01 +02:00
Robert Baldyga
af43a240d3 Return more specific error on CRC mismatch
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-03-28 22:42:59 +02:00
Adam Rutkowski
16c85c1560 Remove ocf_core_new_io
This function is equivalent to calling ocf_volume_new_io()
on core front volume

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-03-28 10:36:19 +02:00
Adam Rutkowski
4a839cd332 Verify standby/active cache state in OCF entry points
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-03-28 09:42:02 +02:00
Robert Baldyga
aa4622cc01 Make core remove error recoverable
First try to clean only the mapping. This operation does not require any
rollback, so even if flushing collision fails, core object is still
intact. In case of error we inform user that core was not removed by
returning new error code (-OCF_ERR_CORE_NOT_REMOVED).

After flushing collision succeeds we remove core from metadata and
flush superblock at the end. At that point the core is fully removed
from OCF and even if superblock flush error occurs there is nothing we
can do about it, so we just return the error code.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-03-25 21:32:55 +01:00
Robert Baldyga
d46845b97a Remove unused error code
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-03-09 11:43:35 +01:00
Robert Baldyga
d5b2c65a39 Remove "metadata_layout" parameter of the cache
This feature is replaced with LRU list shuffling.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-03-07 17:48:25 +01:00
Robert Baldyga
9a956f59cd
Merge pull request #654 from Open-CAS/fix-flapping-merge
Porting fix-flapping patches from v21.6.4 by arutk
2022-03-05 01:31:23 +01:00
Adam Rutkowski
689c44c76b Remove ocf_metadata_probe_cores() implementation
This function must be fixed to work with metadata flapping. Until then
mark as not supported

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
2022-03-04 19:13:40 +01:00
Adam Rutkowski
866bba72bf Explicitly validate superblock after load
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>

Additional changes - load sb recovery CRC check

Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
2022-03-04 19:12:51 +01:00
Jan Musial
6f1080d6a8 Add missing include in ocf_volume.h
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-02-24 12:27:10 +01:00
Robert Baldyga
6af8d20cee
Merge pull request #655 from hammerg/linux_stdarg_h
Fix compilation error regarding stdarg.h file
2022-02-07 16:28:25 +01:00
Robert Baldyga
49abe816ce
Merge pull request #649 from pdebski21/1023
fix for issue #1023
2022-02-07 16:17:14 +01:00
Gal Hammer
3da29e5f3b Fix compilation error regarding stdarg.h file
Linux includes its own stdarg.h file since version 5.15. This change
allows ocf library to compile as part of a kernel module.

Signed-off-by: Gal Hammer <gal.hammer@huawei.com>
Signed-off-by: Shai Fultheim <shai.fultheim@huawei.com>
2022-02-07 15:10:01 +02:00
Robert Baldyga
e30fd48338
Merge pull request #656 from jfckm/extend-metadata-probe
Include cache mode and cache line size in metadata probe
2022-02-04 13:01:10 +01:00
Jan Musial
8522b0b6e6 Include cache mode and cache line size in metadata probe
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-02-04 08:15:05 +01:00
Piotr Debski
9b980d3f22 fix for issue #1023
Better error for core size mismatch during activation/load

adding pyocf test for new error code

Signed-off-by: Piotr Debski <piotr.debski@intel.com>
2022-01-25 05:18:16 +01:00
Piotr Debski
609a22cfda added ERROR code for superblock mismatch
Signed-off-by: Piotr Debski <piotr.debski@intel.com>
2022-01-08 23:06:10 +01:00
Robert Baldyga
c6644116ae
Merge pull request #614 from robertbaldyga/redesign-standby
Redesign failover standby API
2022-01-04 14:07:05 +01:00
Jan Musial
ae18ce274e Fix cache size requirements and some logging
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-01-03 14:30:07 +01:00
Robert Baldyga
716b5751d6 Redesign failover standby API
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-12-29 20:31:40 +01:00
Adam Rutkowski
b1494f4642 Remove option to failover without detach
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-11-30 15:18:08 +01:00
Robert Baldyga
12160ccc36 Introduce OCF_ERR_MIN/OCF_ERR_MAX
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-11-25 15:53:24 +01:00
Rafal Stefanowski
0b39711b8b Add promote-on-threshold sequential cutoff switch
Decide whether to promote sequential cutoff stream
to global structures when threshold is reached

Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2021-11-09 12:54:15 +01:00
Rafal Stefanowski
f22da1cde7 Fix license
Change license to BSD-3-Clause

Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2021-10-28 13:08:50 +02:00
Krzysztof Majzerowicz-Jaszcz
71262d5097 Cache standby mode API changes
Error for an invalid cache operation while in passive mode added

Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>

Error name correction

Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>

API changes for passive cache mode

Moved the passive cache error return source to the api for flush and
set_param

Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>

Further API changes for passive cache mode

Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>

 Passive api - review changes

Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
2021-10-22 15:10:53 +02:00
Adam Rutkowski
5ad4d937f6 Failover detach
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-10-08 14:52:24 +02:00
Robert Baldyga
7b38ad205c Add cache activation from passive state
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-09-06 20:44:40 +02:00
Robert Baldyga
f96451a698 Introduce ocf_cache_is_passive()
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-09-06 13:49:21 +02:00
Robert Baldyga
1fd9a448d4 Introduce passive cache state
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-09-06 13:49:21 +02:00
Robert Baldyga
8015a30348 Fix documentation of ocf_cache_is_running()
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-09-02 22:38:37 +02:00
Robert Baldyga
43917e88bc
Merge pull request #560 from KanagiAomori/json
Flattened ocf_core_info struct
2021-08-26 09:55:39 +02:00