To make cache stop as simple as possibe and to reduce number of errors, stop
context should be allocated during cache initialize.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
To prevent removing cas_cache module when not all thread were stopped yet, each
of them should keep reference.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
To enable stopping management queue from completion context, last queue_put()
have to be called from separate thread.
After cache is fully deinitialized, thread calls module_put_and_exit() to
prevent scenario when code is still executed, but there are no references to
module.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
If _cas_create_thread() thread failed, queue should be stopped by ocf. One of steps
done during queue stop is stopping kernel thread.
To avoid stopping thread which is not running, additional check was added in
_cas_stop_thread().
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
Right now the classifier is instantiated before device is attached.
This way if we have any IO-classes present on cache device the
classifier will have no knowledge of them and fail to classify IO
correctly.
After moving the classifier init to cache finalization routine we have
all the information needed to initialize properly both in new instance
start path and in load path.
Signed-off-by: Jan Musial <jan.musial@intel.com>
OpenCAS continue to work after one of many cores fails
1. Start cache.
2. Add core1 to previously created cache.
3. Add core2 to previously created cache.
4. Fill cache with pages from core1.
5. Fail core1.
6. Check if core2 is able to use cache.
Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
OpenCAS continues to operate after one of many cores is released:
1. "Start cache",
2. "Add core1 to previously created cache",
3. "Add core2 to previously created cache",
4. "Fill cache with pages from core1",
5. "Check if core2 is able to use cache"
Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
OpenCAS continues to operate after one of many cores is removed:
1. "Start cache",
2. "Add core1 to previously created cache",
3. "Add core2 to previously created cache",
4. "Fill cache with pages from core1",
5. "Remove core1",
6. "Check if core2 is able to use cache"
Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
OpenCAS not allow remove the core on 1 level cache when is used by level 2:
/1/ "Create multilevel intelcas device",
/2/ "Try to remove intelcas device on level 1",
/3/ "Remove intelcas device"
Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>