Commit Graph

168 Commits

Author SHA1 Message Date
Adam Rutkowski
2aba5a2843 Add volume_params argument to bottom volume open
This pointer is used to provide optional volume specific data
from the user down to bottom volume open callback. volume_params
is provided to OCF in ocf_mngt_cache_device_config.volume_params.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-04-01 19:28:14 -04:00
Michał Mielewczyk
cc30794160
Merge pull request #93 from arutk/test_build_werror
Treat warnings as errors in tests/build/Makefile
2019-04-01 15:28:49 +02:00
Adam Rutkowski
e06082c4a3 Treat warnings as errors in tests/build/Makefile
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-04-01 12:38:43 -04:00
Adam Rutkowski
7e9ff6456d
Merge pull request #92 from mmichal10/fix-preventing-metadata-override
Return error on start when detected old metadata of not flushed cache.
2019-03-29 16:29:22 +01:00
Michal Mielewczyk
a1075f7cf6 Return error on start when detected old metadata of not flushed cache.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-03-29 11:22:49 -04:00
Adam Rutkowski
d34942e7e5
Merge pull request #91 from mmichal10/fix-cleaning-pol-ret-val
Fix inappropriate return value when setting cleaning policy
2019-03-29 15:53:21 +01:00
Michal Mielewczyk
05be94f7e5 Fix inappropriate return value when setting cleaning policy
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-03-29 10:45:45 -04:00
Robert Bałdyga
5f4ce72c4d
Merge pull request #90 from arutk/ioclass-0-lowercase
Rename default IO class to lowercase "unclassified"
2019-03-29 13:29:44 +01:00
Adam Rutkowski
9a3713fe74 Rename default IO class to lowercase "unclassified"
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-03-29 15:15:44 -04:00
Robert Bałdyga
40f1e9e0d3
Merge pull request #89 from arutk/prv-increase_io_class_name_size
Increase IO class name length limit
2019-03-27 14:11:16 +01:00
Michal Wysoczanski
901bbc5ebf Make ioclass name bigger
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-03-27 17:09:01 -04:00
Jan Musiał
04c3802717
Merge pull request #88 from robertbaldyga/has-pending-cleaning
Introduce ocf_cache_has_pending_cleaning() function
2019-03-27 11:27:15 +01:00
Robert Baldyga
5699422586 Introduce ocf_cache_has_pending_cleaning() function
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-03-26 15:09:52 +01:00
Michał Wysoczański
03c95d36f0
Merge pull request #82 from robertbaldyga/asynchronous-metadata
Handle metadata asynchronously
2019-03-26 12:54:26 +01:00
Robert Baldyga
6cd84476f6 Handle metadata asynchronously
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-03-26 12:49:23 +01:00
Michał Wysoczański
bf9b85150f
Merge pull request #87 from arutk/prv-async_flush
Asynchronous flush and purge - part 2
2019-03-26 12:34:24 +01:00
Adam Rutkowski
54374639b8 Asynchronous wait for dirty requests in flush
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-03-26 15:23:42 -04:00
Adam Rutkowski
7003d38b44 Encapsulate request reference counting logic in utils_refcnt
In order to synchronize management operations with I/O OCF
maintains in-flight request counters. For example such ref
counters are used during ocf_mngt_detach to drain requests
accessing cache metadata (cache requests counter) and in
ocf_mngt_flush where we wait for outstanding requests sent
in write back mode (dirty requests counter).

Typically I/O threads increment cache/dirty counter when
creating request and decrement counter on request completion.
Management thread sets atomic variable to signal the start of
management operation. I/O threads react to this by changing
I/O requests mode so that the cache/dirty reference counter
is not incremented. As a result reference counter keeps getting
decremented. Management thread waits for the counter to drop to 0
and proceeds with management operation with assumption that no
cache/dirty requests are in progress.

This patch introduces a handy utility for requests reference
counting logic. ocf_refcnt_inc / dec are used to increment/
decrement counter. ocf_refcnt_freeze() makes subsequent
ocf_refcnt_inc() calls to return false, indicating that counter
cannot be incremented at this moment. ocf_refcnt_register_zero_cb
can be used to asynchronously wait for counter to drop to 0.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-03-26 15:22:31 -04:00
Michał Wysoczański
08a5b9d2a4
Merge pull request #86 from Donaim/delay-put-cache
Put cache after doing pipeline_destroy
2019-03-26 11:38:01 +01:00
Vitaliy Mysak
2f2f004867 Put cache after doing pipeline_destroy
Cache is used during pipeline_destroy which means that
doing put_cache before destroying pipeline may result in
accessing memory that was freed.

Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
2019-03-26 19:30:34 +00:00
Adam Rutkowski
1a234744ef Fix flush cache error handling
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-03-25 22:26:53 -04:00
Adam Rutkowski
8998e145f2
Merge pull request #84 from Donaim/atomic-dec-return
atomic_dec_return -> env_atomic_dec_return
2019-03-25 19:48:20 +01:00
Vitaliy Mysak
51396bf0e6 atomic_dec_return -> env_atomic_dec_return
Fix usage of undefined function

Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
2019-03-26 02:55:45 +00:00
Robert Bałdyga
a084c1cb1c
Merge pull request #80 from arutk/prv-async_flush
Asynchronous flush and purge operations - part 1
2019-03-22 23:24:10 +01:00
Adam Rutkowski
0d0fd0be75 Asynchronous implementation of flush and purge - part 1
For flush/purge entry points to be fully asynchronous we still
need to rework flush mutex and waiting for outstanding dirty
requests.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-03-22 17:04:33 -04:00
Adam Rutkowski
6ac6081b25
Merge pull request #83 from robertbaldyga/add-missing-rwsem-up
Add missing env_rwsem_up_write() in ocf_cleaner_run()
2019-03-22 15:58:30 +01:00
Robert Baldyga
ae1f600b57 Add missing env_rwsem_up_write() in ocf_cleaner_run()
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-03-22 15:51:40 +01:00
Adam Rutkowski
82fe4c04ee
Merge pull request #81 from robertbaldyga/add-missing-context-size
Add missing context size to pipeline properties
2019-03-22 10:37:57 +01:00
Robert Baldyga
9c72aed559 Add missing context size to pipeline properties
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-03-22 10:27:42 +01:00
Michał Wysoczański
2a2f14ec42
Merge pull request #77 from robertbaldyga/async-save-core-add-remove
Implement asynchronous save, add core and remove core
2019-03-22 10:01:39 +01:00
Robert Bałdyga
70df1d80a1
Merge pull request #79 from Donaim/cleaner-set-queue
Set io_queue for cleaner IOs
2019-03-21 10:08:39 +01:00
Vitaliy Mysak
b9cae8b164 Set io_queue for cleaner IOs
Send cleaner IOs with appropriate queue set
This solves the issue of bottom adapter getting NULL in io->io_queue

Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
2019-03-21 10:03:56 +01:00
Robert Bałdyga
07b2642995
Merge pull request #78 from Donaim/remove-undefined-declaration
Remove undefined declaration: ocf_cleaner_set_io_queue
2019-03-21 09:37:19 +01:00
Vitaliy Mysak
b2b0a56fbd Remove undefined declaration: ocf_cleaner_set_io_queue
Function ocf_cleaner_set_io_queue is not used and not defined
But is declared

This patch removes declaration

Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
2019-03-21 09:17:44 +01:00
Robert Baldyga
72b6f35f52 Implement asynchronous save, add core and remove core
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-03-21 09:03:59 +01:00
Adam Rutkowski
f81a7e9d23
Merge pull request #76 from robertbaldyga/utils-pipeline-arg
Parametrize pipeline steps
2019-03-21 09:00:52 +01:00
Robert Baldyga
23b0a32aec Parametrize pipeline steps
This allows to reuse same step functions giving them different parameters
on each step.

Additionally move pipeline to utils, to make it accessible to other
subsystems of OCF (e.g. metadata).

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-03-20 17:06:56 +01:00
Michał Wysoczański
7a3b3fd84f
Merge pull request #75 from robertbaldyga/asynchronous-cache-attach
Implement asynchronous attach, load and stop
2019-03-19 11:43:40 +01:00
Robert Baldyga
91e0345b78 Implement asynchronous attach, load, detach and stop
NOTE: This is still not the real asynchronism. Metadata interfaces
are still not fully asynchronous.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-03-18 15:06:57 +01:00
Michał Mielewczyk
56f4d34920
Merge pull request #71 from robertbaldyga/asynchronous-api
Make management API asynchronous
2019-03-12 10:51:24 +01:00
Robert Baldyga
c5df82f2cb Make management API asynchronous
NOTE: This patch only changes API that pretends to be asynchronous.
Most of management operations are still performed synchronously.
The real asynchronism will be introduced in the next patches.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-03-12 10:33:26 +01:00
Michal Rakowski
e21b617841
Merge pull request #69 from mmichal10/alru-clean-improvement
Alru clean improvement
2019-03-11 12:45:26 +01:00
Michal Mielewczyk
d06f376627 Alru cleaning policy improvement
Instead of calling flush separatly for each IO class, it is called after
collecting number of dirty cache lines defined by user or after iterating
through all IO classes.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-03-11 04:08:16 -04:00
Michal Mielewczyk
b611c0e67a Calling completions function in nop cleaning policy.
Unlocking cache and putting queue are perormed in cleaning completion, so all
cleaning policies has to call completion.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-03-11 04:08:16 -04:00
Robert Bałdyga
d86e253fe9
Merge pull request #68 from abysdom/master
Fix incorrect image paths in HOME.md
2019-03-11 09:01:47 +01:00
Katarzyna Łapińska
415230b7bc
Merge pull request #34 from micrakow/test_adapters
Test adapters
2019-03-07 12:57:11 +01:00
Michal Rakowski
e5227cef89 Implement pyocf adapter with sample OCF test
PyOCF is a tool written with testing OCF functionality in mind.
It is a Python3 (3.6 version required) package which wraps OCF
by providing Python objects in place of OCF objects (volumes, queues,
etc). Thin layer of translation between OCF objects and PyOCF objects
enables using customized behaviors for OCF primitives by subclassing
PyOCF classes.

This initial version implements only WT and WI modes and single,
synchronously operating Queue.

TO DO:

  - Queues/Cleaner/MetadataUpdater implemented as Python threads
  - Loading of caches from PyOCF Volumes (fix bugs in OCF)
  - Make sure it works multi-threaded for more sophisticated tests

Co-authored-by: Jan Musial <jan.musial@intel.com>
Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
Signed-off-by: Jan Musial <jan.musial@intel.com>
2019-03-07 12:48:40 +01:00
Yang Yuanzhi
f78428193e Fix incorrect image paths in HOME.md
Signed-off-by: Yang Yuanzhi <yangyuanzhi@gmail.com>
2019-03-07 12:39:41 +08:00
Michal Rakowski
794b008127
Merge pull request #66 from robertbaldyga/metadata-probe-asynchronous
Make metadata probe asynchronous
2019-03-04 12:26:34 +01:00
Michal Rakowski
bd19b9c12f
Merge pull request #67 from robertbaldyga/cache-trylock
Add cache locking functions in trylock variant
2019-03-04 11:19:54 +01:00