Commit Graph

240 Commits

Author SHA1 Message Date
Robert Baldyga
e6710e0016 cas_cache: Add promotion count parameter
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-03-07 20:36:57 +01:00
Robert Baldyga
9bc827a4f2
Merge pull request #721 from mmichal10/update-ocf
Update ocf
2021-03-07 20:34:55 +01:00
Michal Mielewczyk
099eeca864 Ioclass min_size removed from public ocf api
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-03-05 16:09:37 +01:00
Jan Musial
f1a19363e5 Include mpool in env and use new allocator API
Signed-off-by: Jan Musial <jan.musial@intel.com>
2021-03-05 14:02:08 +01:00
Jan Musial
bcc55f4f3c Extend allocator API
Create function for directly changing the size of rpool backing created
allocator.

Signed-off-by: Jan Musial <jan.musial@intel.com>
2021-03-03 11:17:22 +01:00
Adam Rutkowski
68b68db9c0 Zero metadata if on-disk version differs from current
Kernel adapter now returns is_cache_device=1 and newly added
metadata_compatible=0 in case of metadata detected with
differing version (instead of is_cache_device = 0).

This allows zero-superblock command to recognize old
cache instance and clear it.

casadm --script --check-cache-device still returns 'Is cache'='no'
in this case, as this layer only cares about metadata in current
version to be able to detect dirty datas tatus.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-01-21 14:47:54 -06:00
Rafal Stefanowski
43f43068ad Update copyright statements (2021)
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2021-01-21 13:15:38 +01:00
Michal Mielewczyk
4d61ded26d Fix use after free bug
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-01-20 02:28:19 -05:00
Slawomir Jankowski
a057a0082f Handle cache stopping interruption
Ignore the interruption of the stop operation - will finish asynchronously.
Remove redundant `ocf_queue_put`.
Move creating the `finish_thread` during the cache stop
from the `_cache_mngt_cache_stop_sync` to the `cache_mngt_exit_instance`
and give it a proper handling.

Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
2021-01-19 16:25:11 +01:00
Robert Baldyga
ca3e1a5984 Revert "modules: use si_mem_available() when possible"
This method produced too optimistic free memory value, which in result
led to oom killer activation. This patch restores more conservative
free memory calculation method.

This reverts commit 1e9b7a4262.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-01-14 15:16:09 +01:00
Robert Baldyga
02c3910677 Handle error in ocf_metadata_probe() complete callback properly
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-01-13 15:20:54 +01:00
Robert Baldyga
42c3f3ed8c
Merge pull request #613 from robertbaldyga/start-finalize-sync
Handle cache start finalize synchronously
2020-12-31 21:11:24 +01:00
Robert Baldyga
6bd2681134
Merge pull request #611 from robertbaldyga/shorten-cleaner-thead-name
Shorten cleaner thread name
2020-12-31 21:11:10 +01:00
Robert Baldyga
238b11846b Handle cache start finalize synchronously
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-12-31 19:49:03 +01:00
Robert Baldyga
ea581953e1 Shorten cleaner thread name
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-12-30 18:12:21 +01:00
Robert Baldyga
f87e6970a5 Fix listing caches
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-12-30 17:58:16 +01:00
Robert Baldyga
2753bad018
Merge pull request #568 from mmichal10/occupancy-per-ioclass
Occupancy per ioclass
2020-12-23 14:36:02 +01:00
Michal Mielewczyk
36cf52940b env: print format for 64 bits signed int
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-12-23 07:23:02 -05:00
Michal Mielewczyk
3c678e57d7 classifier: fix string comparison
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-12-23 07:23:02 -05:00
Robert Baldyga
7e40570bbd Remove #ifdef for unsupported kernel version
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-12-22 11:33:38 +01:00
Robert Baldyga
bcd6f4831c Update atomic mode support check
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-12-22 11:33:38 +01:00
Robert Baldyga
1810010093 Use default kernel export mechanism when symbol lookup is not available
Since kernel 5.7 kallsyms_on_each_symbol() is not available.
NOTE: This affects ability to perform upgrade in flight on kernels 5.7+.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-12-22 11:33:38 +01:00
Robert Baldyga
0596597f61 Replace ioctl_by_bdev() with vfs_ioctl()
Since kernel 5.8 ioctl_by_bdev() is not available.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-12-22 11:33:38 +01:00
Robert Baldyga
c596c66063 configure: Add wrappers for default make request function
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-12-22 11:33:38 +01:00
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