Commit Graph

473 Commits

Author SHA1 Message Date
Adam Rutkowski
9975706488 pyocf: Move poison out of Volume class
.. so that abstract Volume does not need to be imported to access
the poison value.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-03-28 10:29:02 +02:00
Adam Rutkowski
232133302b pyocf: use generic volume submit in io class
.. instead of submit_core(). This will enable to reuse Io class
for cache exported object I/O.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-03-28 10:29:02 +02:00
Adam Rutkowski
2de7b9d8f2 pyocf: submit_flush() and submit_dicard()
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-03-28 10:29:02 +02:00
Adam Rutkowski
efd6389e74 pyocf: add get_default_queue to core object
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-03-28 10:29:02 +02:00
Robert Baldyga
2cba3f4473
Merge pull request #673 from jfckm/settle-in-tests
Settle in start_stop tests before checking stats
2022-03-28 09:47:18 +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
Jan Musial
4d3abc37d5 Settle in start_stop tests before checking stats
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-03-18 10:56:46 +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
73f3b73f0f
Merge pull request #663 from pdebski21/1023_xfail
Test for load with changed core size
2022-03-02 21:03:00 +01:00
Robert Baldyga
765d1c5d77 rio: fix size comparison in
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-02-24 15:02:46 +01:00
Jan Musial
cd0551e72e Use rio in promotion policy tests
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-02-24 14:56:09 +01:00
Adam Rutkowski
a6d8bd0470 rio: accept queue list in Rio constructor
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-02-24 14:56:09 +01:00
Adam Rutkowski
372b1f1e1c remove unnecessary callback decorator in rio
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-02-24 14:56:09 +01:00
Adam Rutkowski
9baf9a3876 rio: convert Size to bytes for extent calculation
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-02-24 14:56:09 +01:00
Jan Musial
9360e55851 Update basic pyOCF tests to use rio
Signed-off-by: Jan Musial <jan.musial@intel.com>
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-02-24 14:56:09 +01:00
Adam Rutkowski
17eddab094 pyocf: queue settle functionality
Queue settle is a mechanism to wait for all OCF processing
on a given queue to finish.

In some tests simply waiting for I/O to finish is not enough. Most
notably some statistics are potentially incremented after user triggered
I/O is finished. This is due to asynchronous nature of I/O operations
and OCF approach to statistics update, where only eventual consistency
is guaranteed without explicit mechanism available to query whether
the final state is reached yet. However it is fully in the adapter power
to determine this, as OCF executes in context of API calls from the
adapter (like I/O submission, ocf_queue_run, ocf_cleaner_run, management
operations) and I/O completion callbacks. Queue settle is a mechanism to
assure ocf_queue_run is not being executed by the thread associated with
a queue.

With queue settle mechanism it is straightforward for the adapter to
wait for cache statistics to reach fixed values:
1. wait for all I/O to OCF to finish
2. settle all I/O queues
3. make sure background cleaner is not active

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-02-24 14:56:09 +01:00
Jan Musial
41732090ae Implement rio io tester for pyocf
rio stands for Rigid IO tester and is a simple mechanism for testing
OCF cache IO.

Signed-off-by: Jan Musial <jan.musial@intel.com>
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-02-24 14:56:09 +01:00
Jan Musial
96124ca87a Enable Size comparisons in pyocf
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-02-24 14:56:09 +01:00
Jan Musial
9fcc7bfbb7 Use new capabilities in surprise shutdown tests
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-02-24 12:27:10 +01:00
Jan Musial
5d31dd87d0 Test for open_cores load
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-02-24 12:27:10 +01:00
Jan Musial
973a474b37 Make open_cores load viable by adding getter for cores
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-02-24 12:27:10 +01:00
Jan Musial
53d2c5a197 Fix test_start_stop_noqueue
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-02-24 12:27:10 +01:00
Jan Musial
bfee654770 Add wrapper for cache_config_set_default
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-02-24 12:27:10 +01:00
Jan Musial
2038c3aa68 Add basic load test with core reattachment and cleanup structures
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-02-24 12:27:10 +01:00
Jan Musial
30fe2eb783 Handle try_add core adding mode
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-02-24 12:27:10 +01:00
Piotr Debski
08907dae5d test for load with changed core size
removing xfail mark and update core oprations after merged ocf patch

Signed-off-by: Piotr Debski <piotr.debski@intel.com>
2022-02-18 23:15:47 +01:00
Jan Musial
1273e9ddfe Fix leaking Volumes and OcfCtx's
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-02-16 07:06:05 +01:00
Jan Musial
8f47cfa5bf Make multiple pyocf loggers viable
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-02-16 07:06:05 +01:00
Jan Musial
441e3c20d7 Clean-up pyocf c-python shared objects instance tracking
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-02-16 07:06:05 +01:00
Jan Musial
4c9d4fe24e Fix pyocf Ctx ownership
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-02-16 07:06:05 +01:00
Robert Baldyga
da59a1c9aa
Merge pull request #634 from arutk/mopft_21.12
pyocf: management operation power failure tests
2022-02-14 14:10:52 +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
76684ed8a9
Merge pull request #642 from robertbaldyga/parallelize
Parallelize metadata initialization
2022-02-07 13:53:45 +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
b70492ad3d Parallelize ALRU recovery
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-01-31 06:59:28 +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
Adam Rutkowski
a97bc61010 pyocf: mark most surprise shutdown tests as long
.. to skip by default

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-01-13 17:42:42 +01:00
Adam Rutkowski
2b7a249143 pyocf: document custom markers in pytest.ini
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-01-13 17:42:42 +01:00
Adam Rutkowski
ae240f5aa8 pyocf: test update to handle zeroed metadata in attach
With atomic superblock commit during cache attach, it is possible
that power failure interrupts attach operation at a point where
neither new or old superblock is present - right after the superblock
is cleared.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-01-13 17:41:04 +01:00
Adam Rutkowski
366d89a9c4 pyocf: management operation power failure handling tests
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-01-13 17:40:44 +01:00
Adam Rutkowski
ce0bbc260e pycof: explicitly free Volume::_uuid_ dictionary
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-01-13 17:35:33 +01:00
Adam Rutkowski
7f60aa0dd6 pyocf: fix error handling in Cache::stop()
Write error in cache stop means the instance was in fact stopped.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-01-13 17:35:33 +01:00
Adam Rutkowski
ed5185e870 pyocf: make io class config more usable
Unify field param names and include io class id in info struct.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-01-13 17:35:33 +01:00
Adam Rutkowski
5fe217d96f pyocf: set proper OCF error codes in Volume
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-01-13 17:35:33 +01:00
Adam Rutkowski
c43059a4cf pyocf: add get_bytes() function to Volume and Data
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-01-13 17:35:33 +01:00
Adam Rutkowski
683174c78f pyocf: add option to load cache without openning cores
... this is useful to workaround current pyocf limitations and
load cache with manual core insertion

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-01-13 17:35:33 +01:00
Adam Rutkowski
58dac85f7b pyocf: add ocf_core_get_uuid() wrapper
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-01-13 17:35:29 +01:00
Adam Rutkowski
c7144decf8 pyocf: extend error volume capabilities
Adding option to
1. inject error based on I/O number
2. arm/disarm error injection for easier testing

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-01-13 16:40:54 +01:00
Adam Rutkowski
cf72664c2c pyocf: fix cache device config
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-01-13 16:40:54 +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
716b5751d6 Redesign failover standby API
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-12-29 20:31:40 +01:00
Robert Baldyga
cac5869406
Merge pull request #603 from robertbaldyga/metadata-flapping
Introduce flapping of metadata config sections
2021-12-15 17:11:15 +01:00
Robert Baldyga
98cb9bff70 pyocf: Use bigger cache device size in tests
As amount of fixed size metadata allocated by OCF grows, we need to adjust
test to not try to start cache on device that is too small.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-12-15 15:30:34 +01:00
Robert Baldyga
6d1a5c733e pyocf: Add missing error codes
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-12-13 15:58:59 +01:00
Rafal Stefanowski
decfc8dea6 Remove executable bit from Makefile
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2021-11-24 17:01:03 +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
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
Robert Baldyga
7d43aae3a0 pyocf: Add new error codes
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-09-06 20:44:40 +02:00
Robert Baldyga
865d29d0cb
Merge pull request #527 from arutk/clc_ut_fix
fix debug logs in cacheline concurrency UT tests
2021-07-29 23:18:16 +02:00
Michal Mielewczyk
a072e071e2 Remove metadata updated from security tests
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-07-29 09:51:29 +02:00
Michal Mielewczyk
1620c544a1 pyocf: update cleaning policy switching test
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-07-27 15:44:33 +02:00
Michal Mielewczyk
a94677f433 Fix cleaning UT
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-07-27 15:44:33 +02:00
Michal Mielewczyk
92f9c3d532 UT framework: fix misspelled variable name
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-07-27 15:44:18 +02:00
Kozlowski Mateusz
f494448f97 Align structures to cacheline
Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
2021-07-08 12:46:39 +02:00
Michal Mielewczyk
98d2ce0264 pyocf: test for removing dirty core
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-06-28 17:40:49 +02:00
Adam Rutkowski
3775ab0e37 fix debug logs in cacheline concurrency UT tests
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-06-26 16:55:25 +02:00
Adam Rutkowski
1e1955b833 lru refactor
rearanging lru implementation for easier journaling

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-06-21 22:32:57 +02:00
Adam Rutkowski
07cbba32f6 remove stale references to eviction
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-06-18 12:19:08 +02:00
Adam Rutkowski
33e2beac24 Rename "evp_lru*" functions to "ocf_lru*"
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-06-18 12:19:08 +02:00
Adam Rutkowski
b1143374a8 Move eviction files to new locations
src/eviction/lru.c -> src/ocf_lru.c
src/eviction/lru.h -> src/ocf_lru.h
src/eviction/lru_structs.h -> src/ocf_lru_structs.h
src/eviction/eviction.c -> src/ocf_space.c
src/eviction/eviction.h -> src/ocf_space.h

.. as well as corresponding UT files.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>

... in UT as well

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-06-18 12:19:08 +02:00
Adam Rutkowski
7c0f940876 Replace eviction with lru in metadata structs
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-06-18 12:19:08 +02:00
Adam Rutkowski
88e04a4204 Remove eviction policy abstraction
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-06-18 12:19:08 +02:00
Adam Rutkowski
77bccba036 do not track hotness on free lru list
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-06-18 12:19:08 +02:00
Adam Rutkowski
fac35d34a2 Rename "evict" to "remap" across the entire repo
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-06-18 12:19:08 +02:00
Adam Rutkowski
4f217b91a5 Remove partition list
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-06-18 12:19:08 +02:00
Adam Rutkowski
87f834c793 Move common user and freelist partition data to a new struct
New structure ocf_part is added to contain all the data common for both
user partitions and freelist partition: part_runtime and part_id.
ocf_user_part now contains ocf_part structure as well as pointer to
cleaning partition runtime metadata (moved out from part_runtime) and
user partition config (no change here).

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-06-18 12:07:10 +02:00
Kozlowski Mateusz
367fcbfe4e Update debug prints and methods
Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
2021-06-16 13:48:37 +02:00
Kozlowski Mateusz
c17b587444 Update cache line concurrency unit tests
Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
2021-06-16 13:48:37 +02:00
Kozlowski Mateusz
ce316cc67c Change alock API to include slow/fast lock callbacks
Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
2021-06-16 13:48:35 +02:00
Adam Rutkowski
f589341c9a remove metadata updater
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-06-15 10:25:05 +02:00
Jan Musial
9f1df6e380 Update pyOCF and tests
Signed-off-by: Jan Musial <jan.musial@intel.com>
2021-05-26 07:57:37 +02:00
Michal Mielewczyk
d5ae764175 pyocf: fix valid seq cutoff threshold range
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-04-15 11:09:26 +02:00
Michal Mielewczyk
0bfa9ed870 pyocf: Seq-cutoff promotion count security tests
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-04-14 15:40:29 +02:00
Michal Mielewczyk
8e0bb49493 functional test for eviction between cores
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-04-01 18:01:28 -05:00
Kozlowski Mateusz
3f9af8bd82 Update pyocf types to new field order
Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
2021-03-26 08:57:04 +01:00
Michal Mielewczyk
92a5ddd524 ut framework: don't mock env functions
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-03-19 16:08:27 +01:00
Michal Mielewczyk
0d3f3cde14 Return error when modifying default ioclass rule
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-03-19 16:06:23 +01:00
Robert Baldyga
8020e7fd67
Merge pull request #457 from Ostrokrzew/false_stats
Fix broken 'dirty_for' stats
2021-03-18 10:24:02 +01:00
Michał Mielewczyk
d2b5de7970
Merge pull request #448 from robertbaldyga/perqueue-seq-cutoff
Per-queue multi-stream sequential cutoff
2021-03-05 14:38:21 +01:00
Adam Rutkowski
81fc7ab5c5 Parallel eviction
Eviction changes allowing to evict (remap) cachelines while
holding hash bucket write lock instead of global metadata
write lock.

As eviction (replacement) is now tightly coupled with request,
each request uses eviction size equal to number of its
unmapped cachelines.

Evicting without global metadata write lock is possible
thanks to the fact that remaping is always performed
while exclusively holding cacheline (read or write) lock.
So for a cacheline on LRU list we acquire cacheline lock,
safely resolve hash and consequently write-lock hash bucket.
Since cacheline lock is acquired under hash bucket (everywhere
except for new eviction implementation), we are certain that
noone acquires cacheline lock behind our back. Concurrent
eviction threads are eliminated by holding eviction list
lock for the duration of critial locking operations.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-03-05 11:20:47 +01:00
Robert Baldyga
9352c881ab tests: Update sequential cutoff tests
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-03-04 16:38:31 +01:00
Robert Baldyga
ac9bd5b094
Merge pull request #453 from arutk/no_cl_gl_lock
Skip cacheline concurrency global lock in fast path
2021-03-04 12:33:50 +01:00
Michal Mielewczyk
3a26bc56cd pyocf: improve test logging
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-03-02 18:37:58 +01:00
Michal Mielewczyk
7f862c3080 pyocf: improve random string generator
Set of random characters may be exteded with a custom list.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-03-02 18:37:58 +01:00
Michal Mielewczyk
a81be31dd4 pyocf: default range for int16
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-03-02 18:37:58 +01:00
Michal Mielewczyk
c4a2dc4cad pyocf: security tests for ioclass api
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-03-02 18:37:58 +01:00
Michal Mielewczyk
fa556247d7 pyocf: change encoding of ioclass name
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-03-02 14:46:57 +01:00
Michal Mielewczyk
080e13a071 pyocf: valid ranges for ioclass config values
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-03-02 14:46:57 +01:00
Michal Mielewczyk
06edc48717 pyocf: remove min_size from ioclass config
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-03-02 14:46:57 +01:00
Michal Mielewczyk
95d756de91 Remove ioclass min_size from public API
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-03-02 14:46:57 +01:00
Michal Mielewczyk
5c053ad964 pyocf: security test for seq cutoff threshold
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-02-26 08:24:41 -05:00
Michal Mielewczyk
73d6fb33de pyocf: api for setting core seq cutoff threshold
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-02-26 08:24:41 -05:00
Michal Mielewczyk
9aebf57efa pyocf: valid ranges for seq cutoff threshold
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-02-26 08:24:41 -05:00
Michal Mielewczyk
d909698790 pyocf: fix acp security test
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-02-26 08:24:41 -05:00
Michal Mielewczyk
482861423b pyocf: security test for acp params
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-02-26 08:24:41 -05:00
Michal Mielewczyk
43ff4aae5f pyocf: security test for alru params
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-02-26 08:24:41 -05:00
Michal Mielewczyk
92f67c65f0 pyocf: valid ranges for cleaning policy params
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-02-26 07:56:38 -05:00
Slawomir Jankowski
eeda1f3f0f Unify type of dirty_for in info structs
Reformat function that calculates how long cache/core is dirty
Update `dirty_for` types in functional tests

Values stored in info structs fields (both in cache and core structs)
are unsigned 64-bits ints but `dirty_for`s were unsigned 32-bits ints.

Use existing function to transform returned value to seconds.
Replace seconds stored in metadata with seconds.
Replacement was done if old value of replaced field was equal to zero.
Acquiring monotonic high precission timestamp is potentially
slow and it makes sense to compare the field's value
to zero before calling atomic function.

Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
2021-02-25 14:51:53 +01:00
Adam Rutkowski
9ff0fd5320 Cacheline concurrency deadlock detection test in UT
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-02-24 17:29:52 -06:00
Robert Baldyga
75baec5aa5
Merge pull request #456 from arutk/aalru
Relax LRU list ordering to minimize list updates
2021-02-18 13:48:54 +01:00
Michal Mielewczyk
83f142c987 Functional test for overflown pinned ioclass
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-02-16 07:07:01 -05:00
Adam Rutkowski
10c3c3de36 Renaming hash bucket locking functions
1. new abbreviated previx: ocf_hb (HB stands for hash bucket)
2. clear distinction between functions requiring caller to
   hold metadata shared global lock ("naked") vs the ones
   which acquire global lock on its own ("prot" for protected)
3. clear distinction between hash bucket locking functions
   accepting hash bucket id ("id"), core line and lba ("cline")
   and entire request ("req").

Resulting naming scheme:
ocf_hb_(id/cline/req)_(prot/naked)_(lock/unlock/trylock)_(rd/wr)

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-02-12 18:08:15 -06:00
Robert Baldyga
d03ea719cd
Merge pull request #451 from arutk/exact_evict_count
only request evict size equal to request unmapped count
2021-02-11 10:47:12 +01:00
Adam Rutkowski
1908707a3d LRU list unit tests
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-02-09 16:23:01 -06:00
Adam Rutkowski
4276d65e5a unit tests for new eviction order
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-02-09 12:51:39 -06:00
Adam Rutkowski
5538a5a95d Only request evict size equal to request unmapped count
Removing the logic for oportunistic partition overflow
reduction by evicting more cachelines than actually
required by the request being serviced.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-02-09 11:11:15 -06:00
Robert Baldyga
3543f5c5cc
Merge pull request #443 from rafalste/update_copyright
Update copyright statements (2021)
2021-02-03 11:59:39 +01:00
Michal Mielewczyk
3a7b55c4c2 Don't evict on hit
If request is hit, simply try to acquire cachelines instead of verifying
whether target partition's size is not exceeded.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-01-29 17:15:32 -05:00
Rafal Stefanowski
6ed4cf8a24 Update copyright statements (2021)
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2021-01-21 13:17:34 +01:00
Robert Baldyga
dd508c595f
Merge pull request #430 from rafalste/fix_attach_load_paths
Create separate pipelines and paths for cache attach/load scenarios
2020-12-23 16:51:37 +01:00
Robert Baldyga
69e388a10f
Merge pull request #372 from arutk/wo_test_enhancements
Extend WO engine functional tests
2020-12-23 16:51:16 +01:00
Rafal Stefanowski
57d4aaf7c9 Return error status from ocf_freelist_init
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2020-12-23 16:43:46 +01:00
Rafal Stefanowski
88b97df16d Fix pipeline attach/load paths
Create separate pipelines for cache attach and load scenarios.

Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2020-12-23 16:31:49 +01:00
Michal Mielewczyk
2206b2fdef pyocf: cache attach test
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-12-21 08:23:34 -05:00
Michal Mielewczyk
5c2a5c5e79 pyocf: add cache detach api
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-12-21 08:23:34 -05:00
Michal Mielewczyk
93318696cd pyocf: ioclass api
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-12-21 08:23:34 -05:00
Michal Mielewczyk
76148de310 Unit tests for mapping
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-12-21 08:23:34 -05:00
Michal Mielewczyk
418303eee8 UT for occupancy per ioclass utils
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-12-21 08:23:34 -05:00
Adam Rutkowski
680074eebc Add build requirements to unit tests readme
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2020-12-17 14:35:28 +01:00
Adam Rutkowski
d52083a445 unit tests for lru iterator
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2020-12-17 14:35:27 +01:00
Robert Baldyga
8b03271626 rbtree: Introduce list find callback
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-11-10 13:21:14 +01:00
root
934ea045fe Cover all read paths with read data integrity test logic
Extending read test to run in all cachemodes.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2020-11-06 14:43:53 -06:00
Adam Rutkowski
fef9d94a10 Rename WO data integrity test to "read" data integrity
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2020-11-06 14:43:53 -06:00
Adam Rutkowski
62497cabee Extend WO engine funcional tests
1. Adjust test to work with multiple cache lines
2. Extend test workset to cover larger I/O

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2020-11-06 14:43:53 -06:00
Robert Baldyga
4f80cde9dd
Merge pull request #382 from mmichal10/tree-ut
ut: tests for rb tree
2020-10-20 14:38:53 +02:00
Robert Baldyga
9a23787c6b
Merge pull request #406 from arutk/flush2
Propagate I/O flags (e.g. FUA) to metadata flush I/O
2020-10-06 12:49:22 +02:00
Adam Rutkowski
2b1c74ee86 Add test to check whether flush is sent after mngmt op
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2020-09-30 10:40:23 +02:00
Adam Rutkowski
693c07b865 pyocf: fix cache save method
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2020-09-30 10:40:14 +02:00
Adam Rutkowski
c7417b29fc pyocf: test for io flags propagation to bottom volumes
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2020-09-29 18:25:34 +02:00
Michal Mielewczyk
9b8ac42e0f ut: tests for rb tree
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-07-15 10:37:01 -04:00
Robert Baldyga
1c9312842a
Merge pull request #369 from rafalste/copyright_update
Update copyright statements
2020-05-06 12:42:10 +02:00
Rafal Stefanowski
38e7e19290 Update copyright statements
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2020-04-28 13:37:54 +02:00
Michal Rakowski
0f85a73669 pyocf: test_eviction fixup
Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
2020-04-24 15:34:59 +02:00
Robert Baldyga
188559416c
Merge pull request #354 from robertbaldyga/multistream-seq-cutoff
Introduce multi-stream seqential cutoff
2020-04-22 15:35:42 +02:00
Jan Musial
9a8eb7ed90 Basic test for multistream seq cutoff
Signed-off-by: Jan Musial <jan.musial@intel.com>
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-04-22 13:30:42 +02:00
Jan Musial
93a0d9554c Implement API for setting seq cutoff threshold
Signed-off-by: Jan Musial <jan.musial@intel.com>
2020-04-22 13:30:42 +02:00
Jan Musial
e4b11b6933 Add context to OcfCompletion
Signed-off-by: Jan Musial <jan.musial@intel.com>
2020-04-22 13:30:42 +02:00
Jan Musial
52962402fe Extend Size class to enable arithmetics
Signed-off-by: Jan Musial <jan.musial@intel.com>
2020-04-22 13:30:42 +02:00
Robert Baldyga
a9c36477d2 Fix deadlock on concurrent flush at the same cache
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-04-03 18:09:35 +02:00
Robert Baldyga
f7d191b765 ut: Add cache allocation & do little cleanup
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-03-23 12:38:43 +01:00
Robert Baldyga
c295a4f670 ut: Add .gitignore
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-03-23 12:33:12 +01:00
Jan Musial
e5aff609d9 Add test for huge cache
Signed-off-by: Jan Musial <jan.musial@intel.com>
2020-01-21 15:29:24 +01:00
Robert Baldyga
ce28c71475
Merge pull request #326 from Ostrokrzew/upstream
Change error code
2020-01-10 13:38:18 +01:00
Kamil Lepek
5828a7d0ae Added codecov badge to README, added coverage files to .gitignore 2020-01-09 10:54:59 +01:00
Michal Rakowski
bc866e5f9a pyocf: fix security mngmt_start_fuzzy test 2020-01-08 14:06:54 +01:00
Kamil Lepek
0d6660d4f3 Enable code coverage tracking in pyocf 2020-01-08 11:02:07 +01:00
Ostrokrzew
3fca309e51 Change error code and add new
Change 'OCF_ERR_START_CACHE_FAIL' to 'OCF_ERR_NO_MEM' while CAS fails in case of memory lack on device.
Add new error code for case, when device doesn't satisfy CAS requirements - 'OCF_ERR_INVAL_CACHE_DEV'.
Use 'OCF_ERR_INVAL_CACHE_DEV' in code.
Update error code match in test.
closes #317 issue

Signed-off-by: Ostrokrzew <slawomir.jankowski@intel.com>
2020-01-02 09:34:24 +01:00
Robert Baldyga
2ca8dcd73e ut: Replace deprecated 'commands' module with 'subprocess'
The 'commands' modules has been removed in python 3.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-12-10 17:39:17 +01:00
Robert Baldyga
1525e85805 Add global random seed config
This is needed to make fuzzy tests work with xdist as each
xdist gateway expects to receive the same set of parameter
values, which for random generators may be achieved only by
providing globally shared seed.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-10-03 16:31:05 +02:00
Robert Baldyga
b9b39fdb46 Add more fine-grained fixtures for fuzzy tests
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-10-03 16:31:05 +02:00
Robert Baldyga
ab1df71476 Make random generator API fluent
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-10-03 14:36:31 +02:00
Katarzyna Lapinska
219ccf360c Add new negative io tests and raising error when failed to create io
Signed-off-by: Katarzyna Lapinska <katarzyna.lapinska@intel.com>
2019-10-02 20:35:25 +02:00
Robert Baldyga
58403f2cd4 Test with io aligned to sector size
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-10-02 19:46:28 +02:00
Michal Rakowski
74954667a2
Merge pull request #308 from arutk/fix_hash_bucket_lock_iter
Fix hash bucket lock iter
2019-10-02 17:22:12 +02:00
Adam Rutkowski
a3f3a79f75 unit test: extend hash bucket locking test
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-10-02 18:43:46 -04:00
Michał Mielewczyk
1ef67ec4b2
Merge pull request #305 from KamilLepek/remove_sec_test
Remove redundant security test (id has been removed for cache in ocf)
2019-10-02 14:58:17 +02:00
Kamil Lepek
fe0d663c25 Remove redundant security test (id has been removed for cache in ocf)
Signed-off-by: Kamil Lepek <kamil.lepek94@gmail.com>
2019-10-02 14:06:06 +02:00
Slawomir_Jankowski
717b8aa259 UT prapare update
**CMake lists**: link Zlib;
include libs for UT during compilation.
**prapare script**: add path to regular ocf_env files;
ignore 'memcpy' functions when copied to wrappers.
**cleaning policy**: update of some functions for proper use of atomics.

Signed-off-by: Slawomir_Jankowski <slawomir.jankowski@intel.com>
2019-10-01 14:28:27 +02:00
Slawomir_Jankowski
5d0a6fa05a UT cleanup and path update
**run tests script**: cleanup before UT starts;
usage of regular ocf_env files by symlinks.
**tests conifg**: add path to regular ocf_env files.

Signed-off-by: Slawomir_Jankowski <slawomir.jankowski@intel.com>
2019-10-01 14:26:38 +02:00
Slawomir_Jankowski
e248c68846 Delete duplicates
Delete unnecessary duplicated ocf_env files from UT directory.

Signed-off-by: Slawomir_Jankowski <slawomir.jankowski@intel.com>
2019-10-01 14:25:26 +02:00
Slawomir_Jankowski
0696ec1f9c Aesthetic changes
Aesthetic changes, typos fix and delete recursive inclusions.

Signed-off-by: Slawomir_Jankowski <slawomir.jankowski@intel.com>
2019-10-01 14:24:16 +02:00
Michał Mielewczyk
e02821d399
Merge pull request #302 from Deixx/empty-cache-name
Recognize empty string as an incorrect cache name
2019-10-01 13:19:20 +02:00
Daniel Madej
35d71e14f3 Recognize empty string as an incorrect cache name
Signed-off-by: Daniel Madej <daniel.madej@intel.com>
2019-10-01 12:55:46 +02:00
Adam Rutkowski
5113542c7f
Merge pull request #297 from mmichal10/pp-params-in-sb
Store PP config params in cache superblock.
2019-10-01 12:32:15 +02:00
Michal Mielewczyk
e16d4e6dda Initialize promotion policy on cache attach.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-10-01 06:11:53 -04:00
Robert Baldyga
29f0f33502 tests: functional: Add pretty random generators
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-10-01 09:49:02 +02:00
Slawomir_Jankowski
cdf0caf704 **ocf_mngt.h**: In core name change
pointer type to array which is 32 characters long;
**core.py**: Add missing import and modify class' field type
to keep consistency;
**ocf_mngt_core**: Remove local variable 'name';
remove env_vmalloc for 'name' - isn't no longer needed;
remove initialization 'name' - as above;
remove env_vfree for context->cfg.name - variable isn't no allocated
in memory;
check if cfg->name exists;
change label in goto from deleted err_name to the closest err_pipeline.

Signed-off-by: Slawomir_Jankowski <slawomir.jankowski@intel.com>
2019-09-30 15:55:33 +02:00
Michal Mielewczyk
dfc55538ce Store PP config params in cache superblock.
It allows to modify and retrieve particular PP params event if it isn't active
and store values between cache stop and load.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-09-27 10:55:58 -04:00
Robert Baldyga
6a0fb109e8 test_eviction: Use new_io() method with proper arguments
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-09-27 12:08:11 +02:00
Michal Mielewczyk
d332c9d97f New ocf error code in test framework.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-09-25 03:54:33 -04:00
Adam Rutkowski
938795e081 Unit tests for hash bucket locks ordering
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-09-20 17:21:00 -04:00
Jan Musial
21a3945a3c Fix PP tests
Signed-off-by: Jan Musial <jan.musial@intel.com>
2019-09-20 14:56:32 +02:00
Michał Mielewczyk
9d41c94827
Merge pull request #264 from KamilLepek/new_sec
Negative tests for promotion policy
2019-09-19 12:45:09 +02:00
Jan Musial
6b1d1754db Fix secure erase tests
Signed-off-by: Jan Musial <jan.musial@intel.com>
2019-09-19 10:10:20 +02:00
Kamil Lepek
71d8c8d698 Negative tests for promotion policy
Signed-off-by: Kamil Lepek <kamil.lepek94@gmail.com>
2019-09-18 17:59:40 +02:00
Kamil Lepek
daae1b915d Fix for security tests need of name param when creating multiple cores
Signed-off-by: Kamil Lepek <kamil.lepek94@gmail.com>
2019-09-18 11:12:58 +02:00
Michał Mielewczyk
0391fc17b7
Merge pull request #255 from imjfckm/pp-tests
Add promotion policies functional tests
2019-09-16 09:34:16 +02:00
Michal Mielewczyk
5042c5fc43 pyocf: adapt tests to new inactive cores stats.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-09-16 02:49:42 -04:00
Jan Musial
9c51ca4e97 Tests for promotion policy
Signed-off-by: Jan Musial <jan.musial@intel.com>
2019-09-11 10:31:14 +02:00
Michal Rakowski
29c1c7f9e8
Merge pull request #253 from mmichal10/stats-refactor
Stats builder for ioclasses
2019-09-10 14:56:26 +02:00
Michal Mielewczyk
5f357272d1 pyocf: adjust pyocf to new core stats api
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-09-10 08:01:09 -04:00
Adam Rutkowski
0c31cc62d0 Freelist test
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-09-09 16:19:52 -04:00
Adam Rutkowski
964ba85467 unit tests: improve test logs content
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-09-09 16:19:52 -04:00
Robert Bałdyga
5fd239d2bb
Merge pull request #245 from imjfckm/switching-pp
Switching mechanism for promotion policies
2019-08-30 11:35:16 +02:00
Adam Rutkowski
63c71ec6df pytest: basic cache recovery test
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-08-29 17:06:26 -04:00
Jan Musial
a1d3cf0c4d Switching mechanism for promotion policies
Signed-off-by: Jan Musial <jan.musial@intel.com>
2019-08-29 13:24:26 +02:00
Michal Rakowski
e3a20c0da0
Merge pull request #239 from imjfckm/pp-implementation
nhit promotion policy implementation
2019-08-27 12:42:03 +02:00