Commit Graph

1350 Commits

Author SHA1 Message Date
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
Robert Baldyga
90ff4afcda Check superblock CRC before it is used
Superblock can be used during load of other sections, so we need to check
its CRC before other sections are loaded.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
2022-03-04 19:12:08 +01:00
Krzysztof Majzerowicz-Jaszcz
06f2140090 Removing ocf_metadata_sb_crc_recovery
Removing ocf_metadata_sb_crc_recovery - not used

Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
2022-03-04 19:10:47 +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
Robert Baldyga
d53047b5f9
Merge pull request #657 from robertbaldyga/standby-remove-runtime-recovery
Remove runtime recovery in standby mode
2022-02-07 15:56:59 +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
76684ed8a9
Merge pull request #642 from robertbaldyga/parallelize
Parallelize metadata initialization
2022-02-07 13:53:45 +01: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
Robert Baldyga
c176daeec1
Merge pull request #640 from pdebski21/superblock_mismatch
added error code for superblock mismatch
2022-02-03 15:30:03 +01:00
Robert Baldyga
805ea14529 Remove runtime recovery in standby mode
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-02-01 03:11:50 +01:00
Robert Baldyga
6a665ea6b1 Shuffle entries within freelists
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-01-31 06:59:28 +01:00
Robert Baldyga
53f6cffe7f tests: Add unit tests for bisect generator
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-01-31 06:59:28 +01:00
Robert Baldyga
481e5b7b9b Introduce bisect generator utility
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-01-31 06:59:28 +01:00
Robert Baldyga
93391c78d8 Parallelize ACP recovery
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-01-31 06:59:28 +01:00
Robert Baldyga
b70492ad3d Parallelize ALRU recovery
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-01-31 06:59:28 +01:00
Robert Baldyga
8cc71cc9cb Remove ocf_cleaning_init_cache_block() from metadata rebuild
Cleaning policy initializaton initializes metadata for all cache lines
anyway, so this step is not needed.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-01-28 19:30:41 +01:00
Robert Baldyga
48bed40dd7 Reconstruct freelist during metadata rebuild
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-01-28 19:30:39 +01:00
Robert Baldyga
f3e4f8c2db Parallelize ocf_mngt_rebuild_metadata()
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-01-28 19:29:52 +01:00
Robert Baldyga
036aca41b3 Parallelize ocf_lru_populate()
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-01-28 19:29:21 +01:00
Robert Baldyga
6611b25d1e Initialize LRU lists in domain of cache lines
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-01-28 19:29:21 +01:00
Robert Baldyga
57fd5c1f20 Introduce ocf_parallelize utility
Introduce utility that allows to parallelize management operation across
all available io queues.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-01-28 19:29:21 +01:00
Robert Baldyga
a947127f55 Introduce ocf_lru_add_free() function
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-01-28 19:29:21 +01:00
Robert Baldyga
b82d30a0ef Add missing hb lock functions implementation
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-01-28 19:29:21 +01:00
Robert Baldyga
25e2551964 Check core status during recovery based on core metadata
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-01-28 19:29:21 +01:00
Robert Baldyga
568c565497 Init properties before loading superblock
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-01-28 19:29:21 +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
Robert Baldyga
f4daf05237
Merge pull request #639 from arutk/eha
Fix error handling in cache attach
2022-01-19 15:26:34 +01:00
Robert Baldyga
bef79c9b9a
Merge pull request #643 from robertbaldyga/seq_no-in-atomic
Set core_seq_no only in atomic mode
2022-01-19 12:29:25 +01:00
Robert Baldyga
fb8bea67b6 Set core_seq_no only in atomic mode
This prevents using up pool of seq numbers in normal mode and blocking
addition of any new cores.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-01-19 11:38:12 +01:00
Robert Baldyga
c35eb2a15c
Merge pull request #575 from arutk/async_example
simple example: implement queues based on threads
2022-01-18 12:36:39 +01:00
Adam Rutkowski
02066f3cdf simple example: implement queues based on threads
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-01-18 11:55:31 +01:00
Adam Rutkowski
a32a787e3d Fix error handling in cache attach
Only close cores in error handling if attach parameter "open_cores" is
set to true.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-01-13 17:26:47 +01:00
Robert Baldyga
fe990effb1
Merge pull request #638 from mmichal10/missing-return
Add missing return in raw_ram_zero() in error path
2022-01-12 12:29:34 +01:00
Michal Mielewczyk
5d74aec921 Add missing return in raw_ram_zero() in error path
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-01-12 07:46:49 +01:00
Robert Baldyga
9d62972b74
Merge pull request #632 from arutk/rv_21.12
Extended metadata validation in recovery path
2022-01-10 13:27:11 +01:00
Adam Rutkowski
294e02bc1b Fail cache recovery in case of erroneous mapping
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-01-10 11:10:02 +01:00
Robert Baldyga
913966e3f9
Merge pull request #630 from arutk/sb_zero
atomic initialization of on-disk metadata during cache attach
2022-01-10 09:14:58 +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
Adam Rutkowski
9693b82cf9 Only flush superblock at the end of cache attach
The purpose of this change is not to write superblock to the cache
drive untill all other sections are initilized on disk in attach()
path. Combined with superblock clearing at the erarlier stage of
attach(), this assures there are no residual mappings in the collision
section in case of power failure during attach with pre-existing
metadata.

This is implemented by removing ocf_metadata_flush_all_set_status() step
at the beginning of ocf_metadata_flush_all().
ocf_metadata_flush_all() is called, except for the attach() case described
above, in two cases:
1. at the end of cache load - potentially after cache recovery
2. during detaching cache drive in cache stop.

To make sure there are no regressions in the first case, an explicit
_ocf_mngt_attach_shutdown_status() is added to load pipeline before
ocf_metadata_flush_all(). The second case is always ran after cache
drive is attached, so dirty status bit must have already be written to
the disk.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-01-05 13:06:59 +01:00
Adam Rutkowski
196437f9bc Zero superblock before writing metadata
This is the first step towards atomic initialization of metadata
on cache disk.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-01-05 13:06:59 +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
Robert Baldyga
4d4cdece0d
Merge pull request #637 from jfckm/fix-cache-size-req
Fix cache size requirements and some logging
2022-01-03 20:17:21 +01:00
Robert Baldyga
4aa3d8f9df Remove "unsafe" path from standby load
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-01-03 20:10:40 +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
02ea894252
Merge pull request #635 from robertbaldyga/fix-closing-volume-stanby-stop
Fix closing volume on standby stop
2021-12-30 12:59:28 +01:00
Robert Baldyga
b40fa0c2bf Fix closing volume on standby stop
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-12-29 20:54:45 +01:00
Robert Baldyga
86a2896bcf Rename "bind" to "standby"
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-12-29 20:32:03 +01:00