Commit Graph

15 Commits

Author SHA1 Message Date
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
Robert Baldyga
1ec0040767 Set proper metadata version for coming 19.09 release
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-09-18 18:42:21 +02:00
Adam Rutkowski
13cf871a13 Per-execution-context freelists
Global free cacheline list is divided into a set of freelists, one
per execution context. When attempting to map addres to cache, first
the freelist for current execution context is considered (fast path).
If current execution context freelist is empty (fast path failure),
mapping function attempts to get freelist from other execution context
list (slow path).

The purpose of this change is improve concurrency in freelist access.
It is part of fine granularity metadata lock implementation.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-09-09 16:19:52 -04:00
Adam Rutkowski
f892bb962d posix env: add spinlock trylock
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-09-09 16:19:51 -04:00
Adam Rutkowski
7f442fd943 Adding execution context get/put to posix env
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-09-09 16:19:49 -04:00
Robert Baldyga
74bd0e3f7b env: Ensure that env_strncpy() always produces NULL-terminated string
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-08-29 08:13:37 +02:00
Firas Medini
1f979f630b Adding synchronization primitives destroyers
Environment should provide calls for destroying primitives (i.e. env_mutex_destroy()) and OCF should call these functions in its cleanup paths.

Signed-off-by: Firas Medini <mdnfiras@yahoo.com>
2019-08-13 05:13:11 -07:00
Robert Baldyga
877f8b1443 env: posix: Fix recursive mutex
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-07-23 13:23:01 +02:00
Michal Rakowski
4789fb38f0 Added asserts in sample env for synchronization functions
Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
2019-06-11 11:01:06 +02:00
Michal Wysoczanski
d08c1b3a75 Avoid using 'new' (C++ reserved keyword) as argument name.
Signed-off-by: Michal Wysoczanski <michal.wysoczanski@intel.com>
2019-05-30 00:11:47 +02:00
Adam Rutkowski
cf24b46a58 posix env: evaluate ENV_BUG_ON condition unconditionally
OCF depends on ENV_BUG_ON condition to be evaluated as it
may have side effects. So simple implementation with
"assert(!cond)" is not good enough as it will likely be noop
in release build.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-04-18 17:54:05 -04:00
Adam Rutkowski
9528d1bf64 Add secure alloc/free to posix env
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-04-18 17:53:59 -04:00
Robert Baldyga
9b9b965b55 Add cache locking functions in trylock variant
- Add cache trylock and read trylock functions.
- Introduce new error code -OCF_ERR_NO_LOCK.
- Change trylock functions in env to return this code in case of
  lock contention.

[ENV CHANGES REQUIRED]
Following functions should return 0 on success or -OCF_ERR_NO_LOCK
in case of lock contention:
- env_mutex_trylock()
- env_rwsem_up_read_trylock()
- env_rwsem_up_write_trylock()

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-03-01 17:31:32 +01:00
Robert Baldyga
ad10d58a2c Update posix environment
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-01-15 09:41:33 +01:00
Robert Baldyga
37372574a4 Introduce default POSIX environment
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-01-10 13:53:44 +01:00