Commit Graph

216 Commits

Author SHA1 Message Date
Robert Baldyga
48c3598ef5 configure: Add bdev_disk_changed() wrapper
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-12-22 11:33:38 +01:00
Robert Baldyga
d9ea8d3e32 configure: Add blk_queue_make_request() wrapper
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-12-22 11:33:38 +01:00
Robert Baldyga
ca7f809965 configure: Add __vmalloc() wrapper
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-12-22 11:33:38 +01:00
Robert Baldyga
bbd0cb57a5 configure: Update generic_acct wrapper to kernel 5.8
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-12-22 11:33:38 +01:00
Robert Baldyga
933c98b00a
Merge pull request #538 from arutk/flush
Remove potentially_dirty counter from bottom volume
2020-11-30 10:10:50 +01:00
Robert Baldyga
fc5b7f6c53 Add missing header
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-11-18 22:37:05 +01:00
Robert Baldyga
539e64e2c9
Merge pull request #566 from robertbaldyga/deb-dkms
Introduce DKMS support for DEB packages
2020-11-05 14:01:32 +01:00
Robert Baldyga
3060aaf95f Introduce DKMS support for DEB packages
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-11-04 11:47:34 +01:00
Jan Musial
b217e406be Perform volume test only for atomic device
Signed-off-by: Jan Musial <jan.musial@intel.com>
2020-11-02 11:39:37 +01:00
Adam Rutkowski
7905ca79fa Remove potentially_dirty counter from bottom volume
This counter is not accurate (missing required memory barrier
to avoid unwanted behavior due to processor optimizations)
and performance gain is not clear - generally global
atomic variables are something we would like to avoid
going forward.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2020-09-29 15:21:11 +02:00
Michal Mielewczyk
8b64206570 configure: add CAS_BLK_BIDI_RQ() macro
Since commit 8b3238cabd50e27 in linux kernel removed blk_bidi_rq() marco, it
has to be wrapped in CAS `configure` script

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-08-25 08:46:24 -04:00
Michal Rakowski
1cd1db2b45 Fully remove format nvme command
Since there is no kernel-kernel api available to communicate
with nvme driver it is more convenient to use some nvme-dedicated
software (e.g. nvme-cli) to manage nvme devices.
It is even not possible to format nvme device with CAS using current
implementation on newest kernels.

Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-08-11 06:10:31 -04:00
Robert Baldyga
b8cfee1883
Merge pull request #435 from rafalste/update_versioning
Version unifying
2020-07-27 18:34:46 +02:00
Robert Baldyga
4fb2600721
Merge pull request #457 from robertbaldyga/better-cas-thread-names
Improve CAS thread names
2020-07-08 16:21:12 +02:00
Michal Mielewczyk
017c4261b0 cas_cache: log failed creating exported object
To avoid logging the same message each time _cache_mngt_create_exported_object()
is called, print error message within it.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-07-07 08:28:53 -04:00
Michal Mielewczyk
296cb0ef86 cas_cache: log failed activating exported object
To avoid logging the same message each time block_dev_activate_exported_object()
is called, print error message within it.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-07-07 08:28:53 -04:00
Michal Mielewczyk
8363b67993 cas_disk: handle allocation error properly
In case of error `blk_mq_init_queue()` does not return NULL, but
`ERR_PTR(error_code)` instead.

`IS_ERR_OR_NULL()` should be used to check if `blk_mq_init_queue()` actually
failed.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-07-07 07:43:52 -04:00
Robert Baldyga
83410b2abf Improve CAS thread names
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-07-03 15:05:00 +02:00
Michal Mielewczyk
c71b5fcbd3 Access attach command conditionaly
If cache is restored after upgrade, NULL is passed instead of
`struct kcas_start_cache`. This leads to null pointer dereference.

To prevent null pointer dereference, `struct kcas_start_cache` is tested before
each use

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-06-16 04:20:51 -04:00
Michal Mielewczyk
975ec6f32a Keep pointer to rollback thread in start_finalize
If cache is initialized successfully, `struct _cache_mngt_attach_context` might
be freed in `cache_mngt_init_instance()`. In such case pointer to rollback
thread can't be accessed and thread can't be stopped.

To prevent such scenario pointer should be kept in separate variable.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-06-16 04:20:51 -04:00
Rafal Stefanowski
afa0c1b53f Modify version check flow
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2020-06-10 15:08:37 +02:00
Michal Mielewczyk
b0f8a67071 Core id based io classification
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-05-21 08:44:20 -04:00
Robert Baldyga
1e25420f86
Merge pull request #404 from rafalste/copyright_update
Update copyright statements
2020-05-19 11:25:11 +02:00
Michal Mielewczyk
3b62e40a2e Purge core command
Purge invalidates all cache lines which belongs to given core. It is very
usefull feature for tests.

Calling purge is possbile with casadm `--script` swtich.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-05-12 11:32:01 -04:00
Michal Mielewczyk
d24288a9b1 Purge cache command
Purge invalidates all cache lines. It is very usefull feature for tests.

Calling purge is possbile with casadm `--script` swtich.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-05-12 11:32:01 -04:00
Rafal Stefanowski
44b4020cc1 Update copyright statements
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2020-05-04 16:47:38 +02:00
Robert Baldyga
382247b5e7
Merge pull request #407 from imjfckm/schedule-in-sort
Add conditional reschedules to env_sort
2020-04-30 15:35:34 +02:00
Jan Musial
d25b059e2c Add conditional reschedules to env_sort
Sorting can take a long time with big cache sizes and a lot of dirty
data. Make sure we reschedule frome time to time to avoid lockups.

Signed-off-by: Jan Musial <jan.musial@intel.com>
2020-04-29 11:34:40 +02:00
Michal Rakowski
1e9b7a4262 modules: use si_mem_available() when possible
Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
2020-04-29 11:05:41 +02:00
Robert Baldyga
f127d7c825 Update version to v20.6 (WIP version)
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-04-22 16:13:00 +02:00
Robert Baldyga
162f0a477a
Merge pull request #382 from robertbaldyga/update-ocf-flush-deadlock
Update OCF and handle new error code
2020-04-06 10:05:32 +02:00
Robert Baldyga
d694228263 Update OCF and handle new error code
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-04-06 09:03:14 +02:00
Michal Mielewczyk
e1b8ddbc40 Pass remove core result to cli
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-04-01 22:30:43 -04:00
Robert Baldyga
603308f689
Merge pull request #374 from mmichal10/memory-find
Stop cache threads synchronously
2020-03-31 15:30:15 +02:00
Michal Mielewczyk
664c974e03 Revert "Free thread memory after it is stopped."
This reverts commit d483951ebe.
2020-03-31 08:23:57 -04:00
Michal Mielewczyk
1b3424a485 Revert "Free memory of all allocated threads."
This reverts commit 4ec277433d.
2020-03-31 06:46:27 -04:00
Michal Mielewczyk
758c5aa895 Don't hold reference to module in thread
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>
2020-03-31 06:41:11 -04:00
Robert Baldyga
299d1211ef
Merge pull request #372 from mmichal10/memory-find
Alloc rpool with strict memory requirements
2020-03-30 13:30:52 +02:00
Adam Rutkowski
82137c9bc1 Improve _env_allocator_item fields alignment
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>
2020-03-30 00:39:26 +02:00
Robert Baldyga
6bb4dde213
Merge pull request #369 from mmichal10/async-stop-compl
Before stop wait for start to be finished
2020-03-27 13:59:18 +01:00
Michal Mielewczyk
8c57dc51c0 Alloc rpool with strict memory requirements
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-03-25 19:25:26 -04:00
Michal Mielewczyk
3edaf30a73 Before stop wait for start to be finished
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>
2020-03-25 06:24:23 -04:00
Michal Mielewczyk
33223bacb9 Fix flush sync wrappers
Call completion function in case of allocation error

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-03-25 01:52:04 -04:00
Michal Mielewczyk
17d5c8599d Use wrapper function to flush cache during stop
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-03-25 01:52:04 -04:00
Michal Mielewczyk
dca9769298 Acquire read lock for flushing cache
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>
2020-03-25 01:52:04 -04:00
Robert Baldyga
de296dd89f
Merge pull request #367 from mmichal10/async-stop-compl
Create finalize thread during stop
2020-03-26 14:16:29 +01:00
Robert Baldyga
af6d3e9d06
Merge pull request #368 from arutk/rpool_debug
Runtime checks for allocator rpool consistency
2020-03-25 15:09:20 +01:00
Robert Baldyga
5b37183e41
Merge pull request #344 from rafalste/add_package_generator
Add package generator script
2020-03-25 12:40:29 +01:00
Michal Mielewczyk
2fffd789c0 Create finalize thread during stop
Creating finalize thread on cache start causes soft lookups during whole
instance lifetime

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-03-24 07:45:33 -04:00
Adam Rutkowski
d822a1d12e Runtime checks for allocator rpool consistency
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2020-03-24 01:58:11 +01:00