Commit Graph

74 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
Rafal Stefanowski
38e7e19290 Update copyright statements
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2020-04-28 13:37:54 +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
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
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
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
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
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
Jan Musial
62a0ccdd9f nhit promotion policy implementation
Signed-off-by: Jan Musial <jan.musial@intel.com>
2019-08-22 13:34:38 +02:00
Slawomir_Jankowski
679bc38770 OCF Cleanup
**ocf_env**: deleting unused functions from main file

Signed-off-by: Slawomir_Jankowski <slawomir.jankowski@intel.com>
2019-08-09 14:45:29 +02:00
Kamil Łepek
05be67a72b
Merge pull request #220 from arutk/metadata_offset_hash
New hash function formula
2019-07-29 13:03:04 +02:00
Adam Rutkowski
9b8815935a Unit test for hashing function
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-07-29 13:24:25 -04:00
Adam Rutkowski
494861c994 Rename cache_concurrency to cache_line_concurrency
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-07-24 15:32:12 -04:00
Michal Mielewczyk
3005b6b5b5 Prevent warpping ocf_mngt_cache_mode_has_lazy_write() in UT.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-06-28 07:39:24 -04:00
Kamil Lepek
e52d34c1c8 Adapt all python code to PEP8 style standards
Signed-off-by: Kamil Lepek <kamil.lepek94@gmail.com>
2019-06-13 17:55:41 +02:00
Michal Mielewczyk
3e2ee7a7c8 UT framerwok: Auto generating wrap functions
Test code have to contain wraps only for those functions, which are used by
test itself. Empty wraps are generated automatically by UT framework.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-06-06 08:20:25 -04:00
Michal Mielewczyk
e6bedb692c Unified management functions prefix.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-06-05 09:31:59 -04:00
Robert Baldyga
711de86bff Associate core metadata with core object
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-05-28 14:49:59 +02:00