Commit Graph

1648 Commits

Author SHA1 Message Date
Robert Baldyga
c6071bbbb4
Merge pull request #760 from robertbaldyga/license-check-on-relase-branches
Enable "Licence-date-verification" check on release branches
2022-11-22 20:25:00 +01:00
Robert Baldyga
d0bfa94853
Merge pull request #761 from DocentSzachista/remove-ocf-io-start
remove ocf_io_start function
2022-10-31 12:22:19 +01:00
Damian Raczkowski
d2ea41cdbc remove ocf_io_start function
Signed-off-by: Damian Raczkowski <damian.raczkowski@intel.com>
2022-10-28 15:03:36 +02:00
Robert Baldyga
f69b91ae25 Enable "Licence-date-verification" check on release branches
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-10-17 12:31:37 +02:00
Robert Baldyga
43894dd4a5
Merge pull request #759 from live4thee/add-copyright-line
update copyright line as per requested
2022-10-10 13:52:01 +02:00
David Lee
004e930a9f update copyright line as per requested
Signed-off-by: David Lee <live4thee@gmail.com>
2022-10-09 22:30:36 +08:00
Robert Baldyga
4314e8eb13
Merge pull request #757 from live4thee/alru/add-dirty-ratio
alru: add parameter `max_dirty_ratio'
2022-10-07 15:14:24 +02:00
David Lee
6184ad7759 alru: add parameter `max_dirty_ratio'
With a high dirty ratio and occupancy, OCF might unable to map cache lines
for new requests, thus pass-through the I/O to core devices.  IOPS will
drop afterwards.  We need to control the dirty ratio.

Existing `alru' policy gives user the chance to control the stale buffer
time, activity threshold etc.  They can affect the dirty ratio of the cache
device, but in an empirical manner, more or less.  Introducing
`max_dirty_ratio' can make it explicit.

At first glance, it might be better to implement a dedicated cleaner policy
directly targeting dirty ratio goal, so that the `alru' parameters remains
orthogonal.  But one the other hand, we still need to flush dirty cache
lines periodically, instead of just keeping a watermark of dirty ratio.
It indicates that existing `alru' parameters are still required if we
develop a new policy, and it seems reasonable to make it a parameter.

To sum up, this patch does the following:
- added a 'max_dirty_ratio' parameter with default value 100;
- with default value 100, `alru' cleaner is identical to what is was;
- with value N less than 100, the cleaner (when waken up) will active
  brought dirty ratio to N, regardless of staleness time.

Signed-off-by: David Lee <live4thee@gmail.com>
2022-10-01 17:48:14 +08:00
David Lee
d6b0fbceac a few typo fixes
Signed-off-by: David Lee <live4thee@gmail.com>
2022-10-01 17:48:07 +08:00
Robert Baldyga
15c2986b8d
Merge pull request #756 from mmichal10/speedup-start
Speedup cache initialization
2022-09-29 10:17:29 +02:00
Michal Mielewczyk
7b8093aa34 Refactor cleaning policies initialization
Don't populate cleaning policies during initialization procedure so the user
has to call the latter explicitly.

Until now cleaning policies could be populated in two ways:
- implicitly during cleaning policy initialization,
- explicitly be calling populate.
The difference was that the former was single threaded.

This patch removes the functionally redundant and less efficient code.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-09-26 14:14:40 +02:00
Michal Mielewczyk
c0e99e1f79 cleaning: rename recovery to populate
The function not only recovers cleaning policy metadata but is also utilized
to initialize data structures so more generic name is actually more accurate

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-09-26 14:14:40 +02:00
Michal Mielewczyk
8faf74169a Parallelize initializing hash table
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-09-26 14:14:40 +02:00
Michal Mielewczyk
4dbf740f5b Parallelize initializing collision section
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-09-26 14:14:40 +02:00
Michal Mielewczyk
b50bd1b506 Initialize metadata structures in pipelines
Initializing metadata in an asynchronous manner will allow to use
parallelization utilities in the future commits

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-09-26 14:06:40 +02:00
Michal Mielewczyk
da67112b17 load: init_structures as a separate step
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-09-26 14:06:40 +02:00
Michal Mielewczyk
f8e8d74539 attach: setup promotion policy before cleaning
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-09-26 14:06:40 +02:00
Michal Mielewczyk
ca70ea3fff Deinit cleaning policy if attaching cache failed
Normally cleaning policy would be deinitialized during stopping cache which is
one of steps of error handling e.g in case of failed cache activation. But since
`cache_stop()` may be called only for an attached cache instance, cleaning
policy needs to deinitialized explicitly.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-09-26 14:06:40 +02:00
Michal Mielewczyk
21d5da83d9 A utility for counting queues
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-09-26 14:06:40 +02:00
Michal Mielewczyk
ef997b47fa Fix whitespaces
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-09-23 07:09:41 +02:00
Michal Mielewczyk
ca9d8072df posix env: assert in rwsem unlock
Instead of ignoring `pthread_rwlock_unlock()` return value assert that is must
succeed.

The function returns an error eg. when there is an attempt to unlock the
resource from a different thread than it was originally locked which is illegal
in userspace.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-09-23 07:09:41 +02:00
Robert Baldyga
e9a3ebe460
Merge pull request #746 from pdebski21/fix_debug_kernel_stack_overflow
Stack memory reduction for OCF stats
2022-09-09 09:00:03 +02:00
Robert Baldyga
9ad308d84f
Merge pull request #714 from rafalste/copyright_header_check_improvements
Copyright header check improvements
2022-09-09 08:53:13 +02:00
Robert Baldyga
1c701e4101
Merge pull request #750 from robertbaldyga/remove-req-io-if
Get rid of req->io_if
2022-09-08 22:59:57 +02:00
Rafal Stefanowski
de863c7ec1 copyright/license: Extend file header check
- tighten the copyright regex to include all necessary info
- add checking for proper license identifier
- output only in case of error and put it in stderr

Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2022-09-08 13:13:18 +02:00
Rafal Stefanowski
46229dceed copyright/license: Improve checking for copyright header
Besides looking for files with proper extension, check also listed
files without extension, which should contain this header as well.

Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2022-09-08 13:13:18 +02:00
Rafal Stefanowski
9d7f4becb8 copyright/license: Add missing copyright header
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2022-09-08 13:13:18 +02:00
Robert Baldyga
8db2f1117b
Merge pull request #754 from rafalste/copyright_exclude_renamed
Exclude renamed and copied files from copyright check
2022-09-08 12:27:44 +02:00
Rafal Stefanowski
fbc612d2f5 Exclude renamed and copied files from copyright check
Only added or modified files will be checked for a proper
copyright statement.

Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2022-09-08 11:09:56 +02:00
Robert Baldyga
228c5fc891 Get rid of req->io_if
Remove one callback indirection level. I/O never changes it's direction
so there is no point in storing both read and write callbacks for each
request.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-09-07 23:07:04 +02:00
Robert Baldyga
d0d1db0b8d
Merge pull request #748 from arutk/fas
fix potential out of bound access in req->alock_status manipulation
2022-09-07 17:05:14 +02:00
Robert Baldyga
4d32e4272a
Merge pull request #751 from arutk/cesf
unify cache write error accounting
2022-09-07 11:04:21 +02:00
Robert Baldyga
990d7b9c6e
Merge pull request #753 from arutk/mlpvf
Add missing ocf_metadata_read_sb error handling
2022-09-07 11:04:10 +02:00
Piotr Debski
0aed807ac4 Stack memory reduction for OCF stats
Signed-off-by: Piotr Debski <piotr.debski@intel.com>
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-09-06 14:34:35 +02:00
Robert Baldyga
64167576db
Merge pull request #752 from robertbaldyga/fix-example-valgrind
example: Fix problems reported by valgrind
2022-09-06 13:37:55 +02:00
Adam Rutkowski
0a09d05a8b Add missing ocf_metadata_read_sb error handling
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-09-06 13:24:05 +02:00
Robert Baldyga
8453bb9da1 example: Destroy volume remnant after it's moved
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-09-06 12:02:26 +02:00
Robert Baldyga
0ede30d552 example: Initialize volume memory pool
Avoid uninitialized memory access.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-09-06 12:02:26 +02:00
Adam Rutkowski
83b4455a0e unify cache write error stats accounting
In most (6/9) instances across engines ocf_core_stats_cache_error_update
is called upon each cache volume I/O error, possibly multiple times
per a user request in case of multi-cacheline requests. Backfill,
fast and read engine are exceptions, incrementing error stats only
once per user request.

This commit unifies ocf_core_stats_cache_error_update usage so that
in all the engines error statistic is incremented for once for every
error.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-09-05 21:13:06 +02:00
Adam Rutkowski
0cfb8077c5 allocate fixed map status alongside request struct
It is wastefull to allocate a full 1B to store 1 bit of
alock status per cacheline. Fixed allocation of 128 bits
seems more reasonable.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-08-29 20:02:18 +02:00
Adam Rutkowski
2f3e0b0fd0 more precise req->alock_status size calculations
1. On 1 bit per cacheline is required for the status
2. ... however the size must be 8B aligned

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-08-29 20:01:52 +02:00
Robert Baldyga
93b6ddb8a7
Merge pull request #703 from jfckm/metadata-corruption-tests
Metadata corruption tests
2022-07-22 16:06:41 +02:00
Robert Baldyga
a478b67513
Merge pull request #745 from robertbaldyga/license-headers-__init__.py
Add missing license headers
2022-07-22 14:47:46 +02:00
Robert Baldyga
675cd11f40 Add missing license headers
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-07-22 08:33:55 +02:00
Jan Musial
f1a8bac1db pyocf: Improve logs readability for corruption tests
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-07-19 10:50:11 +02:00
Jan Musial
159fda9356 Security test for metadata corruption in standby activate
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-07-19 10:50:11 +02:00
Jan Musial
e8b46f09ee Security tests for metadata corruption
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-07-19 10:50:11 +02:00
Jan Musial
01166ba55e Security test for cache exported object
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-07-19 10:50:11 +02:00
Jan Musial
b3bd778a78 pyocf: simplify volume open/close API
Make Volumes usable by both pyocf and OCF with clear open/_open split
and clean-up of instance/uuid tracking on C interface only.

Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-07-19 10:50:11 +02:00
Jan Musial
b1b3e134cf pyocf: clean-up hanging device reference
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-07-19 10:50:11 +02:00