Commit Graph

647 Commits

Author SHA1 Message Date
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
Robert Bałdyga
f08f8aa96e
Merge pull request #303 from arutk/fix_cl_locking
Lock cachelines under hash bucket locks
2019-10-01 15:12:31 +02:00
Adam Rutkowski
cf5a92b527 Lock cachelines under hash bucket locks
.. or when holding exclusive global metadata lock.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-10-01 17:09:27 -04: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
Daniel Madej
5d5cc6d7ec
Merge pull request #295 from robertbaldyga/test-random-generators
tests: functional: Add pretty random generators
2019-10-01 12:18:23 +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
Michał Mielewczyk
ee3f2205fd
Merge pull request #300 from arutk/revert_cl_lock_opt
Revert "Optimize cacheline locking in ocf_engine_prepare_clines"
2019-10-01 11:50:20 +02: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
Katarzyna Łapińska
79a2d866ae
Merge pull request #301 from micrakow/missing_env
Add missing env wrapper
2019-10-01 09:13:11 +02:00
Michal Rakowski
fc971b9961 Add missing env wrapper
Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
2019-10-01 09:05:59 +02:00
Adam Rutkowski
09b68297b2 Revert "Optimize cacheline locking in ocf_engine_prepare_clines"
This change introduced a race condition. In some code paths after
cacheline trylock failed, hash bucket lock needed bo be upgraded
in order to obtain asynchronous lock. During hash bucket lock
upgrade, hash read locks were released followed by obtaining
hash write locks. After read locks were released, concurrent
thread could obtain hash bucket locks and modify cacheline
state. The thread upgrading hash bucket lock would need to
repeat traversation in order to safely continue.

This reverts commit 30f22d4f47.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-09-30 23:53:10 -04:00
Adam Rutkowski
944d70288e
Merge pull request #296 from micrakow/sec_rev_fixes
Env fixes & more
2019-09-30 17:42:40 +02:00
Michał Mielewczyk
1eb48ca3ea
Merge pull request #299 from micrakow/env_strncmp
env: change env_strncmp to take 4 args
2019-09-30 17:40:49 +02:00
Michal Rakowski
325994074e env: change env_strncmp to take 4 args
Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
2019-09-30 17:26:47 +02:00
Michal Rakowski
2575be83fa Error handling for env_rwsem_init added
Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
2019-09-30 17:16:37 +02:00
Michal Rakowski
b78557a2cc Change env_spinlock_init to non-void function
Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
2019-09-30 17:15:27 +02:00
Michal Rakowski
8426d662cb Changed err handling to BUG_ON in case of refcnt_int fail durign cache init.
Since we do not expect that incrementing cache's reference counter
during cache init will fail at any condition it is can be changed
to an assert instead of error handling.

Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
2019-09-30 17:15:27 +02:00
Michal Rakowski
9504cb044d discard: Added missing io_put in case of error
Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
2019-09-30 17:15:27 +02:00
Michal Rakowski
f1cfc800e2 Add check for part_id in ocf_stats_collect_part_*
Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
2019-09-30 17:15:27 +02:00
Michal Rakowski
888ac74e32 Removed redundand include
Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
2019-09-30 17:15:27 +02:00
Michal Rakowski
c65a25fff6
Merge pull request #298 from Ostrokrzew/ptr_to_arr
Core name - pointer to array change
2019-09-30 16:06:27 +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
Adam Rutkowski
46e7dd8748
Merge pull request #294 from robertbaldyga/test-eviction-new-io
test_eviction: Use new_io() method with proper arguments
2019-09-27 15:38:03 +02:00
Adam Rutkowski
d6739441de
Merge pull request #293 from robertbaldyga/deinit-cache-lock-on-stop
Deinitialize locks on cache stop instead of put
2019-09-27 15:14:31 +02: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
Robert Baldyga
96a1fdb17e Deinitialize locks on cache stop instead of put
Cache lock waiters hold cache refcount. Because of that,
if there were some waiters, deinitialization of cache
lock on the last put did never happen and putting the
cache was effectively impossible.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-09-27 12:02:04 +02:00
Robert Bałdyga
75569ecaba
Merge pull request #284 from mmichal10/prevent-cache-name-duplicate
Prevent cache name duplicate
2019-09-25 15:36:08 +02:00
Michal Mielewczyk
6c076a7c07 Remove set_cache_name() from public API.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-09-25 09:21:42 -04:00
Michał Mielewczyk
9e707d81b5
Merge pull request #287 from micrakow/nhit_fixe
Nhit fixes
2019-09-25 15:11:47 +02:00
Michal Rakowski
5efa5ac414 nhit PP: Prevent setting nhit policy again if it was already set 2019-09-25 14:59:23 +02:00
Michal Rakowski
547306efea nhit PP: change trigger_threshold to percent value
Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
2019-09-25 14:59:23 +02:00
Michał Mielewczyk
9613c325fc
Merge pull request #285 from arutk/fix_io_class_configure
Fix error handling in IO ocf_mngt_cache_io_classes_configure
2019-09-25 14:42:06 +02:00
Michał Wysoczański
aafe870e44
Merge pull request #280 from arutk/metadata_sync_2
Additional metadata synchronization
2019-09-25 14:11:59 +02:00
Adam Rutkowski
a934b43aec Add missing error handling in hash bucket locks initialization
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-09-25 14:26:17 -04:00
Adam Rutkowski
6de280283a Fix hash_table_entries param type in ocf_metadata_concurrency_attached_init
Number of hash buckets is 32 bit integer.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-09-25 14:26:17 -04:00
Adam Rutkowski
937b010ef6 Synchronize access to cleaner shared structures
Cleaning policy callbacks are typically  called with hash buckets or
cache lines locked. However cleaning policies maintain structures
which are shared across multiple cache lines (e.g. ALRU list).
Additional synchronization is required for theese structures to
maintain integrity.

ACP already implements hash bucket locks. This patch is adding
ALRU list mutex.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-09-25 14:26:17 -04:00
Adam Rutkowski
5e28474322 Adding partition locks
Adding locks to assure partition list consistency. Partition
lists is typically modified under cacheline or hash bucket lock.
This is not sufficient synchronization as adding/removing cacheline
from partition list affects neighbouring cachelines state as well.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-09-25 14:26:17 -04:00
Adam Rutkowski
41d3542952 Lock collision page in metadata flush
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-09-25 14:26:15 -04:00
Michal Mielewczyk
f461f3c62e Extend probe informations with cache name.
Since ocf requires loading cache with the same name as it was stopped, it should
also allow to read name from metadata.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-09-25 07:59:50 -04:00
Michal Mielewczyk
39c5819a51 Set cache name before adding it to context list.
This change allows to check if specified cache name name is unique. To prevent
adding cache instance with the same name, context lock is acquired until name
isn't set.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-09-25 07:59:50 -04:00
Michal Mielewczyk
c04ea4898f Check if loaded cache name is valid.
When loading cache, it's name should be the same as the loaded one.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-09-25 05:06:37 -04:00
Michal Rakowski
23aba6a9f3 nhit PP: Added info about setting nhit params
Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
2019-09-25 11:04:51 +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
be3b402162 Synchronization of collision table
Adding synchronization around metadata collision segment pages.
This part of metadata is modified when cacheline is mapped/unmapped
and when dirty status changes.

Synchronization on page level is required on top of cacheline
and hash bucket locks to assure metadata flush always reads
consistent state when copying entire collision table memory
page.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-09-25 00:26:29 -04:00
Adam Rutkowski
5684b53d9b Adding collision table locks
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-09-24 22:59:35 -04:00
Adam Rutkowski
727a6d2e4b Fix error handling in IO ocf_mngt_cache_io_classes_configure
Modifying _ocf_mngt_io_class_configure and _ocf_mngt_io_class_remove
to never return -OCF_ERR_IO_CLASS_NOT_EXIST error code. This
return code was ignored by the caller anyway. In _ocf_mngt_io_class_remove
-OCF_ERR_IO_CLASS_NOT_EXIST indicated the IO class is already
removed, which is not an error. In _ocf_mngt_io_class_configure
-OCF_ERR_IO_CLASS_NOT_EXIST indicated empty IO class name, which
is actualy invalid input. This change made it possible to remove
erroneous error handling for -OCF_ERR_IO_CLASS_NOT_EXIST case in
ocf_mngt_cache_io_classes_configure.

This change fixes IO class configuration.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-09-24 21:51:43 -04:00
Michal Mielewczyk
2abccadb9e New error code for invaild loaded cache name.
When loading cache metadata, it should be started with exactly the same name as
it was running previously. Otherwise load should fail and return newly added
error code.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-09-24 07:40:21 -04:00