Since stopping threads have to be done synchronusly, there is no need to keep
reference to cas_cache module in each thread.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This change assures that data array is always optimally aligned.
Additionally item boolean flags are put into the same uint32
as cpu number in order to save space for future additions.
This change fixes ~50% performance degradation introduced by
commit d822a1d1.
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
To prevent cache being stopped before async start finialize has finished, stop
routine have to check if worker responsible for finalizing is not running
anymore.
To create link between start finalize and stop functions, work_struct had to be
moved from attach_context to cache_priv.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
Read lock allows to retrieve informations about flushing progress and printing
progress bar during changing cache mode.
Flushing dirty data during changing cache mode is done twice - first flush might
be interrupted by user and the second one, called with write lock acquired, is
uninterruptable.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
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>
- add a 'pckgen' script to generate various OpenCAS packages like
release archives (tar, zip), RPMs (source and binary) as well as to
create version file with metadata
- add a SPEC file for RPM creation
- add Makefile targets to use 'pckgen' script through 'make <package>'
'pckgen' script has a bunch of features for package generation.
Read './pckgen --help' for more information on usage scenarios.
Script is also prepared to easily add new packages creation in the future.
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@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>
When flushing core, acquiring write lock is not necessary, so it was replaced
with read lock wherever possible.
If flushing operation is interrupted by signal, not only waiting for it to be
finished is interrupted but also OCF flush operation is stopped.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
When flushing cache, acquiring write lock is not necessary, so it was replaced
with read lock wherever possible.
If flushing operation is interrupted by signal, not only waiting for it to be
finished is interrupted but also OCF flush operation is stopped.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>