Unify type of dirty_for in info structs
Reformat function that calculates how long cache/core is dirty Update `dirty_for` types in functional tests Values stored in info structs fields (both in cache and core structs) are unsigned 64-bits ints but `dirty_for`s were unsigned 32-bits ints. Use existing function to transform returned value to seconds. Replace seconds stored in metadata with seconds. Replacement was done if old value of replaced field was equal to zero. Acquiring monotonic high precission timestamp is potentially slow and it makes sense to compare the field's value to zero before calling atomic function. Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
This commit is contained in:
@@ -53,7 +53,7 @@ struct ocf_cache_info {
|
||||
* out of WB mode
|
||||
*/
|
||||
|
||||
uint32_t dirty_for;
|
||||
uint64_t dirty_for;
|
||||
/*!< How long there are dirty cache lines (in seconds) */
|
||||
|
||||
ocf_cache_mode_t cache_mode;
|
||||
|
||||
@@ -32,7 +32,7 @@ struct ocf_core_info {
|
||||
};
|
||||
|
||||
/** How long core is dirty in seconds unit */
|
||||
uint32_t dirty_for;
|
||||
uint64_t dirty_for;
|
||||
|
||||
/** Sequential cutoff threshold (in bytes) */
|
||||
uint32_t seq_cutoff_threshold;
|
||||
|
||||
Reference in New Issue
Block a user