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:
@@ -156,8 +156,10 @@ void set_cache_line_dirty(struct ocf_cache *cache, uint8_t start_bit,
|
||||
/*
|
||||
* If this is first dirty cline set dirty timestamp
|
||||
*/
|
||||
env_atomic64_cmpxchg(&req->core->runtime_meta->dirty_since,
|
||||
0, env_get_tick_count());
|
||||
if (!env_atomic64_read(&req->core->runtime_meta->dirty_since))
|
||||
env_atomic64_cmpxchg(
|
||||
&req->core->runtime_meta->dirty_since, 0,
|
||||
env_ticks_to_secs(env_get_tick_count()));
|
||||
|
||||
/*
|
||||
* Update the number of dirty cached data for that
|
||||
|
Reference in New Issue
Block a user