Commit Graph

272 Commits

Author SHA1 Message Date
Jan Musiał
2d4fc035a6
Merge pull request #141 from robertbaldyga/readme-contributing-page
Update README.md
2019-05-08 14:25:19 +02:00
Robert Bałdyga
1c9fe96663
Merge pull request #133 from arutk/ajrutkow_async_counters
Extended reference counting
2019-05-08 14:23:50 +02:00
Michał Wysoczański
8d09d7ae47
Merge pull request #145 from robertbaldyga/remove-interruption-arg-flush
Remove "interruption" argument from flush() functions
2019-05-08 12:02:06 +02:00
Adam Rutkowski
1e812b4eaf Unit tests for reference counter utility
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-05-07 12:40:06 -04:00
Robert Baldyga
7b88aac56f Remove "interruption" argument from flush() functions
As non-interruptible flushes are no longer triggered from OCF
internals, we can get rid of "interruption" argument and let
adapters handle it themselves.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-05-07 17:23:19 +02:00
Michal Rakowski
68dc62407b
Merge pull request #144 from robertbaldyga/bind-cache-lifetime-to-queue-lifetime
Get cache on queue creation and put it on queue destruction
2019-05-07 10:41:48 +02:00
Robert Baldyga
2a1161e384 Update README.md
Add information about "Contibuting" page

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-05-07 09:16:36 +02:00
Adam Rutkowski
c8e6b96ece pyocf: remove put from cache stop to match get count
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-05-06 19:37:51 -04:00
Adam Rutkowski
2485584487 Remove obsolete ocf_cache_wait_for_io_finish from pyocf
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-05-06 19:37:51 -04:00
Adam Rutkowski
84f5454b29 Update unit tests to work with extedned ref counters
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-05-06 19:37:51 -04:00
Adam Rutkowski
aafc067fa5 Combine cache ref counter and valid flag into ocf_refcnt
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-05-06 19:37:51 -04:00
Adam Rutkowski
4251cc63e7 Do not send zero_line request if d2c
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-05-06 19:37:51 -04:00
Adam Rutkowski
af4b9b13d0 Freeze / unfreeze cleaning reference counters in detach/attach
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-05-06 19:37:51 -04:00
Adam Rutkowski
348b0f9ab8 Async wait for cleaner completion
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-05-06 19:37:49 -04:00
Adam Rutkowski
0e15c693fd Return post modification value from ocf_refcnt_inc/dec
If counter is frozen then increment returns 0.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-05-06 19:23:11 -04:00
Adam Rutkowski
962f9d17d1 Remove functions to wait for cache pending requests
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-05-06 19:23:11 -04:00
Adam Rutkowski
92e9ae12f1 Wait for metadata requests in stop
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-05-06 19:23:11 -04:00
Adam Rutkowski
dc716d6a08 Use ref counter to track attach state
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-05-06 19:23:10 -04:00
Adam Rutkowski
979f51612f Move dirty ref counter to cache->refcnt aggregate
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-05-06 19:22:29 -04:00
Adam Rutkowski
555f477248 Do not increment attached metadata counter on behalf of mngt requests
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-05-06 19:22:29 -04:00
Robert Baldyga
42b5cd1777 Get cache on queue creation and put it on queue destruction
This prevents situation when cache object is being destroyed
while some queues still exist.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-05-06 17:30:32 +02:00
Robert Bałdyga
1f62d4e7e5
Merge pull request #137 from arutk/pyocf-queue-put-fix
pyocf: fix management queue stop/put
2019-05-06 17:13:26 +02:00
Adam Rutkowski
9232bfcb72
Merge pull request #142 from robertbaldyga/pipeline-return-cleanup
Cleanup, fixes & improvements
2019-05-06 17:01:44 +02:00
Robert Baldyga
a82d420ee0 Add management queue guards where needed
Prevent starting management operations that require pipeline
when management queue isn't set.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-05-02 17:26:04 +02:00
Robert Baldyga
c2aea209db Introduce pipeline *_RET macros
This simplifies code by allowing to express programmer intent
explicitly and helps to avoid missing return statements (this patch
fixes at least one bug related to this).

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-05-02 17:22:43 +02:00
Robert Baldyga
1373471af7 Introduce OCF_CMPL_RET() macro
This simplifies cases when we want to call completion callback
and immediately return from void-returning function, by allowing
to explicitly express programmers intent. That way we can avoid
cases when return statement is missing by mistake (this patch
fixes at least one bug related to this).

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-05-02 17:22:36 +02:00
Robert Baldyga
bcb2e670f3 metadata: Remove unnecessary check
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-05-02 17:22:28 +02:00
Adam Rutkowski
93c8932a17 pyocf: fix management queue stop/put
Queue is stopped when reference counter drops to 0, so no need to
manually stop management queue after cache stop - simple put is
enough.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-04-25 13:21:25 -04:00
Michał Wysoczański
bb6fe41b9d
Merge pull request #136 from arutk/unplug_error_handling
Refactor cache mngt stop/detach for better error handling
2019-04-23 15:33:16 +02:00
Adam Rutkowski
26579e53cd Refactor cache mngt stop/detach for better error handling
_ocf_mngt_cache_unplug context is now provided by the caller.
This way _ocf_mngt_cache_unplug returns only non-critical (cache write)
errors, allowing stop/detach operation to always proceed and optionally
finish with error. This eliminates the need for rolling back previous
stop/detach operations, which might turn out to be impossible e.g.
under memory pressure.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-04-23 16:16:18 -04:00
Katarzyna Łapińska
bf879c4b09
Merge pull request #113 from Deixx/tests_start_stop
pyocf tests for start/stop
2019-04-23 12:10:17 +02:00
Michał Wysoczański
190812e84a
Merge pull request #135 from arutk/rename_env_ocf_env
Rename makefile ENV* variables to OCF_ENV*
2019-04-23 11:22:39 +02:00
Adam Rutkowski
e11edcacd8 Rename makefile ENV* variables to OCF_ENV*
'ENV' variable is set and used by OS utilities  on some Linux
distros, interfering with OCF build system. Renaming ENV and
other ENV* variables to OCF_ENV* to avoid conflicts.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-04-20 16:54:04 +02:00
Michał Wysoczański
4f2efb0ae7
Merge pull request #134 from Donaim/fix-scanbuild
Fix immediate reassign
2019-04-19 15:30:58 +02:00
Vitaliy Mysak
bf2242fade Fix immediate reassign
Don't reassign value of cache without any previus use.
It produced warnings when analyzing with scanbuild.

Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
2019-04-19 09:25:23 -04:00
Adam Rutkowski
c7df9161be Use secure alloc in _raw_dynamic_get_item
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-04-18 23:11:12 -04:00
Michal Rakowski
9f927de841
Merge pull request #132 from arutk/secure_alloc_dynamic
Use secure alloc in _raw_dynamic_get_item
2019-04-18 21:17:03 +02:00
Daniel Madej
1aa5e99173 Pyocf tests for start/stop
Tests for starting cache and checking if mode works properly
Tests for stopping cache
Negative and stress tests

Signed-off-by: Daniel Madej <daniel.madej@intel.com>
2019-04-18 17:00:14 +02:00
Michał Mielewczyk
d3bfbf6200
Merge pull request #130 from micrakow/kw-fix-ww16_19
Added missing return in metadata_probe_cores
2019-04-18 16:40:36 +02:00
Michal Rakowski
3d6b3ea2e8 Added missing return in metadata_probe_cores
Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
2019-04-18 16:35:05 +02:00
Michał Wysoczański
0b098ddb80
Merge pull request #128 from arutk/secure_alloc
Use env_secure_(alloc/free) macro for metadata allocations
2019-04-18 15:56:57 +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
c5a80cc488 Use env_secure_(alloc/free) macro for metadata allocations
Adapter can opt to take additional steps to securely allocate
memory used by OCF to store cache metadata. Typically this would
involve mlocking pages and zeroing memory before deallocation.

Memory allocated using secure_alloc is not expected to be zeroed
or physically continous.

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
Adam Rutkowski
79cb39e273
Merge pull request #129 from imjfckm/master
Fix cores volumes dropping before close
2019-04-18 09:41:33 -04:00
Jan Musial
be88300071 Fix cores volumes dropping before close
* Add references to Cores in Cache, ctx holds caches, caches hold cores,
  everything gets cleaned up nicely

* GC in Python seems to be a bit lazy, if we want to run CI on
  low-memory machines we need to make sure it does run in between tests
  'cause we don't want no huge Volumes hanging around for long

Signed-off-by: Jan Musial <jan.musial@intel.com>
2019-04-18 14:11:59 +02:00
Daniel Madej
99c448aae6
Merge pull request #124 from katlapinka/security_config
Security tests for start cache command
2019-04-18 14:07:32 +02:00
Kamil Łepek
92837ec2f3
Merge pull request #119 from Deixx/tests_neg_io
Negative tests for IO path
2019-04-18 14:06:15 +02:00
klapinsk
f9eab4c749 Security tests for start cache command 2019-04-18 13:43:27 +02:00
Michal Rakowski
f66579ac8b
Merge pull request #123 from imjfckm/master
Secure erase tests
2019-04-18 13:43:12 +02:00