Commit Graph

1254 Commits

Author SHA1 Message Date
Robert Baldyga
8669a296cc
Merge pull request #579 from mmichal10/fix-passive-update
Maintaining runtime metadata structures in failover standby
2021-11-19 16:53:54 +01:00
Michal Mielewczyk
4ab22ee2dc Maintain runtime struct during failover standby
To allow the fastest switching from the passive-standby to active mode, the
runtime metadata must be kept 100% synced with the metadata on the drive and in
the RAM thus recovery is required after each collision section update.

To avoid long-lasting recovering of all the cachelines each time the collision
section is being updated, the passive update procedure recovers only those
which have its MD entries on the updated pages.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-11-19 11:58:09 +01:00
Michal Mielewczyk
a6989d1881 Pio concurrency 2021-11-19 11:58:09 +01:00
Michal Mielewczyk
52824adaaf Additional cleaning policy info outside of the SB
Starting cache in a standby mode requires access to a valid cleaning policy
type. If the policy is stored only in the superblock, it may be overridden by
one of the metadata passive updates.

To prevent losing the information it should be stored in cache's runtime
metadata.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-11-19 11:53:48 +01:00
Michal Mielewczyk
0e529479d6 Init cleaner during passive start
Initializing cleaning policy is very time consuming. To reduce the time required
for activating cache instance the initialization sholud be done during passitve
start

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-11-19 11:53:48 +01:00
Michal Mielewczyk
390e80794d Refactor cleaning policy initialization
Extract cleaning policy initialization to a separate function

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-11-19 11:53:48 +01:00
Michal Mielewczyk
6d4e6af5b6 Recovery on passive start
Adjust recovery procedure to allow rebuilding metadata from partialy valid
metadata

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-11-19 11:53:48 +01:00
Michal Mielewczyk
11dacd6a84 Set dirty shutdown status on standby init
Since part of the recovery is done during `standby init`, the correct shutdown
status has to be set

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-11-19 11:53:48 +01:00
Michal Mielewczyk
8f58add152 Lru populate unsafe
The unsafe mode is useful if the metadata of added cores is incomplete.

Such scenario is possible when starting cache to standby mode from partially
vaild metadata.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-11-19 11:53:48 +01:00
Michal Mielewczyk
4deaa1e133 Reset all the status bits during recovery
Make sure all the invalid cachelines have reset status bits. This allows to
recognize invalid cachelines easily during populate.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-11-19 11:53:48 +01:00
Michal Mielewczyk
fc7c901c8b Skip collision init on cache start passive
Recovery during passive start is based on the assuption that metadata collision
section stored on disk might be partially valid. Reseting this data would make
rebuilding metadata impossible.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-11-19 11:53:48 +01:00
Michal Mielewczyk
048bbedd71 Fix metadata_clear_valid_if_clean()
The function should return the cacheline's valid status

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-11-19 11:53:48 +01:00
Michal Mielewczyk
bb0ff67fe9 Metadata clear_dirty_if_invalid() utility
Fix cacheline's metadata if it is dirty and invalid

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-11-19 11:53:48 +01:00
Michal Mielewczyk
800190153b Extend lru list API
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-11-19 11:53:48 +01:00
Michal Mielewczyk
5ca1404f06 Fix spelling in the error message
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-11-19 11:53:48 +01:00
Michal Mielewczyk
ccd0abfea5 Add cache line recovery utils to OCF internal API
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-11-19 11:53:48 +01:00
Michal Mielewczyk
a7bdaa751d Add error messages on superblock mismatch
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-11-19 11:53:48 +01:00
Robert Baldyga
f6e337ac79
Merge pull request #586 from rafalste/seq-cutoff_promote_on_threshold
Add promote-on-threshold sequential cutoff switch
2021-11-09 15:22:36 +01:00
Robert Baldyga
55eda53cde
Merge pull request #582 from jfckm/fix-detach-volume
Deinit cache volume on detach
2021-11-09 13:16:08 +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
Jan Musial
55eae1447d Deinit cache volume on detach
Signed-off-by: Jan Musial <jan.musial@intel.com>
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-11-08 18:25:30 +01:00
Robert Baldyga
5cbbfdd5ca
Merge pull request #587 from Open-CAS/gcc_11_fix
Fix for OCL issue #968 -  GCC 11 compilation error
2021-11-08 13:34:52 +01:00
Krzysztof Majzerowicz-Jaszcz
99c54be592 Fix for OCL issue #968 - GCC 11 compilation error
GCC 11 static check finds an array size mismatch and prevents OCF from
compiling correctly. This fixes OpenCAS Linux issue #968

Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
2021-11-08 11:39:17 +01:00
Adam Rutkowski
8f080295bb
Merge pull request #585 from rafalste/license_change
Aplying BSD 3-Clause license to OCF source
2021-10-29 13:16:00 +02:00
Adam Rutkowski
bb2cdae4de
Merge pull request #584 from rafalste/license_change_contributions
Aplying BSD 3-Clause license to OCF source
2021-10-29 13:15:31 +02: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
Rafal Stefanowski
3cc0d07197 License change to be approved by contributors
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2021-10-27 12:48:20 +02:00
Adam Rutkowski
12c8b4e333
Merge pull request #574 from Open-CAS/passive_api
Disable selected management operations in failover standby mode
2021-10-25 10:11:26 +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
e3a8f98bfa
Merge pull request #581 from arutk/cond_clear
Fix conditional valid bit reset
2021-10-20 11:19:46 +02:00
Adam Rutkowski
f9fb80b887 Fix conditional valid bit reset
Status bits outside provided mask shall be unchanged.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-10-12 22:56:45 +02:00
Michał Mielewczyk
7b120162a5
Merge pull request #580 from arutk/failover
Failover detach
2021-10-08 16:31:15 +02:00
Michal Mielewczyk
ad536d9ad9 pyocf: fix cache attach config struct
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
Signed-off-by: ajrutkow <adam.j.rutkowski@intel.com>
2021-10-08 16:04:14 +02:00
Adam Rutkowski
e2c6a25ee9 [REVERTME] Disable option to perform activate without detach
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-10-08 14:52:32 +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
Michał Mielewczyk
d962a89872
Merge pull request #576 from arutk/pipeline_force_async
Always use async queue kick in management pipeline
2021-10-05 15:49:51 +02:00
Adam Rutkowski
48bc6c2f6b Always use async queue kick in management pipeline
Management pipelines tend to consist of multiple asynchronous steps.
Allowing synchronous queue kick results in massive call stacks (e.g.
almost 500 functions deep in case of cache stop). Since async kick
is required anyway, it seems reasonable to switch to async kick
in pipeline implementation.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-09-17 12:39:09 +02:00
Robert Baldyga
8108736c14
Merge pull request #570 from jfckm/fix-example
Fix attach with no cache_line_size specified
2021-09-16 19:12:44 +02:00
Jan Musial
010f30eeaf Validate activate parameters
Signed-off-by: Jan Musial <jan.musial@intel.com>
2021-09-14 08:56:41 +02:00
Jan Musial
b9c84e331c Fix attach with no cache_line_size specified
Signed-off-by: Jan Musial <jan.musial@intel.com>
2021-09-13 12:52:33 +02:00
Robert Baldyga
886c8d4e31
Merge pull request #569 from robertbaldyga/fix-clear-valid-if-clean
Fix metadata_clear_valid_if_clean()
2021-09-10 08:55:34 +02:00
Robert Baldyga
076b5995ed Fix metadata_clear_valid_if_clean()
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-09-10 08:12:11 +02:00
Robert Baldyga
7587bec07c
Merge pull request #567 from robertbaldyga/optimize-out-recovery-sector-loop
Optimize out looping over cache line sectors in recovery
2021-09-08 13:57:32 +02:00
Robert Baldyga
d4c2fa6459
Merge pull request #568 from mmichal10/fix-passive-update
Fix metadata io detection in passive mode
2021-09-08 13:57:22 +02:00
Michal Mielewczyk
612f68b3c1 Fix metadata io detection in passive mode
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-09-08 13:33:04 +02:00
Robert Baldyga
1a3843ba12 Little coding style fix
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-09-07 22:54:10 +02:00
Robert Baldyga
1892f58aba Optimize out looping over cache line sectors in recovery
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-09-07 22:54:10 +02:00
Robert Baldyga
65d3e7a41a Introduce ocf_metadata_clear_valid_if_clean()
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-09-07 22:54:10 +02:00
Robert Baldyga
d7c1404f82 Simplify metadata bit function declarations
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-09-07 22:54:10 +02:00
Robert Baldyga
20741206ed
Merge pull request #566 from robertbaldyga/remove-cache-line-settings
Get rid of struct ocf_cache_line_settings
2021-09-07 17:51:22 +02:00